From eb0b10cbb6d43043715a18f7ab7711726713f44b Mon Sep 17 00:00:00 2001 From: Tristan Cartledge Date: Mon, 4 Dec 2023 17:50:44 +0000 Subject: [PATCH] fix: to callback path items ref issue --- datamodel/low/v3/paths.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datamodel/low/v3/paths.go b/datamodel/low/v3/paths.go index e15c7e5..1cda87e 100644 --- a/datamodel/low/v3/paths.go +++ b/datamodel/low/v3/paths.go @@ -157,10 +157,12 @@ func extractPathItemsMap(ctx context.Context, root *yaml.Node, idx *index.SpecIn pNode := value.pathNode cNode := value.currentNode + foundContext := ctx if ok, _, _ := utils.IsNodeRefValue(pNode); ok { - r, _, err := low.LocateRefNode(pNode, idx) + r, _, err, fCtx := low.LocateRefNodeWithContext(ctx, pNode, idx) if r != nil { pNode = r + foundContext = fCtx if err != nil { if !idx.AllowCircularReferenceResolving() { return buildResult{}, fmt.Errorf("path item build failed: %s", err.Error()) @@ -174,7 +176,7 @@ func extractPathItemsMap(ctx context.Context, root *yaml.Node, idx *index.SpecIn path := new(PathItem) _ = low.BuildModel(pNode, path) - err := path.Build(ctx, cNode, pNode, idx) + err := path.Build(foundContext, cNode, pNode, idx) if err != nil { if idx != nil && idx.GetLogger() != nil { idx.GetLogger().Error(fmt.Sprintf("error building path item '%s'", err.Error()))