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
|
pNode := value.pathNode
|
||||||
cNode := value.currentNode
|
cNode := value.currentNode
|
||||||
|
|
||||||
|
foundContext := ctx
|
||||||
if ok, _, _ := utils.IsNodeRefValue(pNode); ok {
|
if ok, _, _ := utils.IsNodeRefValue(pNode); ok {
|
||||||
r, _, err := low.LocateRefNode(pNode, idx)
|
r, _, err, fCtx := low.LocateRefNodeWithContext(ctx, pNode, idx)
|
||||||
if r != nil {
|
if r != nil {
|
||||||
pNode = r
|
pNode = r
|
||||||
|
foundContext = fCtx
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if !idx.AllowCircularReferenceResolving() {
|
if !idx.AllowCircularReferenceResolving() {
|
||||||
return buildResult{}, fmt.Errorf("path item build failed: %s", err.Error())
|
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)
|
path := new(PathItem)
|
||||||
_ = low.BuildModel(pNode, path)
|
_ = low.BuildModel(pNode, path)
|
||||||
err := path.Build(ctx, cNode, pNode, idx)
|
err := path.Build(foundContext, cNode, pNode, idx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if idx != nil && idx.GetLogger() != nil {
|
if idx != nil && idx.GetLogger() != nil {
|
||||||
idx.GetLogger().Error(fmt.Sprintf("error building path item '%s'", err.Error()))
|
idx.GetLogger().Error(fmt.Sprintf("error building path item '%s'", err.Error()))
|
||||||
|
|||||||
Reference in New Issue
Block a user