mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-07 20:47:45 +00:00
fix: to callback path items ref issue
This commit is contained in:
@@ -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()))
|
||||
|
||||
Reference in New Issue
Block a user