mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Fixed glitch reported by #219
Context was not being carried through correctly when resolving using `Schema()` and using exploded files. Signed-off-by: quobix <dave@quobix.com>
This commit is contained in:
@@ -463,9 +463,12 @@ func (s *Schema) Build(ctx context.Context, root *yaml.Node, idx *index.SpecInde
|
||||
s.Reference = new(low.Reference)
|
||||
s.Index = idx
|
||||
if h, _, _ := utils.IsNodeRefValue(root); h {
|
||||
ref, _, err := low.LocateRefNode(root, idx)
|
||||
ref, _, err, fctx := low.LocateRefNodeWithContext(ctx, root, idx)
|
||||
if ref != nil {
|
||||
root = ref
|
||||
if fctx != nil {
|
||||
ctx = fctx
|
||||
}
|
||||
if err != nil {
|
||||
if !idx.AllowCircularReferenceResolving() {
|
||||
return fmt.Errorf("build schema failed: %s", err.Error())
|
||||
|
||||
Reference in New Issue
Block a user