diff --git a/index/find_component.go b/index/find_component.go index 8afb59d..dc6746a 100644 --- a/index/find_component.go +++ b/index/find_component.go @@ -189,6 +189,11 @@ func (index *SpecIndex) lookupRemoteReference(ref string) (*yaml.Node, *yaml.Nod } else { query = "$" } + + query, err := url.PathUnescape(query) + if err != nil { + return nil, nil, err + } // remove any URL encoding query = strings.Replace(query, "~1", "./", 1) @@ -284,6 +289,11 @@ func (index *SpecIndex) lookupFileReference(ref string) (*yaml.Node, *yaml.Node, query = "$" } + query, err := url.PathUnescape(query) + if err != nil { + return nil, nil, err + } + // remove any URL encoding query = strings.Replace(query, "~1", "./", 1) query = strings.ReplaceAll(query, "~1", "/")