Skip to content

Commit

Permalink
fixed path node extraction.
Browse files Browse the repository at this point in the history
This one of the exceptions.
  • Loading branch information
daveshanley committed Aug 5, 2024
1 parent 8f9eb65 commit 61b8a2f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion datamodel/low/v3/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (p *Paths) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.
p.RootNode = root
utils.CheckForMergeNodes(root)
p.Reference = new(low.Reference)
p.Nodes = low.ExtractNodes(ctx, root)
p.Nodes = low.ExtractNodes(ctx, nil) // don't extract anything.
p.Extensions = low.ExtractExtensions(root)
low.ExtractExtensionNodes(ctx, p.Extensions, p.Nodes)

Expand All @@ -93,6 +93,12 @@ func (p *Paths) Build(ctx context.Context, keyNode, root *yaml.Node, idx *index.
}

p.PathItems = pathsMap

for pm := pathsMap.First(); pm != nil; pm = pm.Next() {
// add path as node to path item, not this path object.
pm.Value().Value.Nodes.Store(pm.Key().KeyNode.Line, pm.Key().KeyNode)
}

return nil
}

Expand Down

0 comments on commit 61b8a2f

Please sign in to comment.