mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
This should be very easy to duplicate to 2.0 and 3.1, now extraction code needs testing. Signed-off-by: Dave Shanley <dave@quobix.com>
28 lines
562 B
Go
28 lines
562 B
Go
// Copyright 2022 Princess B33f Heavy Industries / Dave Shanley
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v3
|
|
|
|
import (
|
|
"github.com/pb33f/libopenapi/datamodel/low"
|
|
v3 "github.com/pb33f/libopenapi/datamodel/low/3.0"
|
|
)
|
|
|
|
type SchemaProxy struct {
|
|
schema *low.NodeReference[*v3.SchemaProxy]
|
|
buildError error
|
|
}
|
|
|
|
func (sp *SchemaProxy) Schema() *Schema {
|
|
s := sp.schema.Value.Schema()
|
|
if s == nil {
|
|
sp.buildError = sp.schema.Value.GetBuildError()
|
|
return nil
|
|
}
|
|
return NewSchema(s)
|
|
}
|
|
|
|
func (sp *SchemaProxy) GetBuildError() error {
|
|
return sp.buildError
|
|
}
|