Skip to content

Commit

Permalink
Fixed glitch reported by #219
Browse files Browse the repository at this point in the history
Context was not being carried through correctly when resolving using `Schema()` and using exploded files.

Signed-off-by: quobix <dave@quobix.com>
  • Loading branch information
daveshanley committed Dec 18, 2023
1 parent a912093 commit 9cf06d3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion datamodel/low/base/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 9cf06d3

Please sign in to comment.