mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-06 04:20:11 +00:00
Tuning up path -> component -> path tooling
This commit is contained in:
@@ -430,7 +430,12 @@ func (index *SpecIndex) ExtractRefs(node, parent *yaml.Node, seenPath []string,
|
||||
|
||||
if i%2 == 0 && n.Value != "$ref" && n.Value != "" {
|
||||
|
||||
loc := append(seenPath, n.Value)
|
||||
v := n.Value
|
||||
if strings.HasPrefix(v, "/") {
|
||||
v = strings.Replace(v, "/", "~1", 1)
|
||||
}
|
||||
|
||||
loc := append(seenPath, v)
|
||||
definitionPath := fmt.Sprintf("#/%s", strings.Join(loc, "/"))
|
||||
_, jsonPath := utils.ConvertComponentIdIntoFriendlyPathSearch(definitionPath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user