mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 04:20:17 +00:00
Working through test coverage of schema proxy
Main logic is now in place, ready for fleshing out. Pattern feels right.
This commit is contained in:
@@ -6,6 +6,7 @@ package base
|
||||
import (
|
||||
"github.com/pb33f/libopenapi/datamodel/low"
|
||||
"github.com/pb33f/libopenapi/index"
|
||||
"github.com/pb33f/libopenapi/utils"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
@@ -55,6 +56,10 @@ type SchemaProxy struct {
|
||||
func (sp *SchemaProxy) Build(root *yaml.Node, idx *index.SpecIndex) error {
|
||||
sp.vn = root
|
||||
sp.idx = idx
|
||||
if rf, _, r := utils.IsNodeRefValue(root); rf {
|
||||
sp.isReference = true
|
||||
sp.referenceLookup = r
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user