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:
Dave Shanley
2022-10-09 19:33:58 -04:00
parent 277c7c0a4c
commit b83e751aa7
3 changed files with 391 additions and 263 deletions

View File

@@ -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
}