diff --git a/datamodel/low/base/schema.go b/datamodel/low/base/schema.go index 9977bbf..887ec6b 100644 --- a/datamodel/low/base/schema.go +++ b/datamodel/low/base/schema.go @@ -638,10 +638,6 @@ func (s *Schema) Build(root *yaml.Node, idx *index.SpecIndex) error { s.XML = low.NodeReference[*XML]{Value: &xml, KeyNode: xmlLabel, ValueNode: xmlNode} } - /* - - */ - // handle properties props, err := buildPropertyMap(root, idx, PropertiesLabel) if err != nil { diff --git a/index/find_component.go b/index/find_component.go index 2f22846..b6d0934 100644 --- a/index/find_component.go +++ b/index/find_component.go @@ -247,6 +247,19 @@ func (index *SpecIndex) lookupFileReference(ref string) (*yaml.Node, *yaml.Node, func (index *SpecIndex) FindComponentInRoot(componentId string) *Reference { if index.root != nil { + + // check component for url encoding. + if strings.Contains(componentId, "%") { + // decode the url. + var err error + componentId, err = url.QueryUnescape(componentId) + if err != nil { + // TODO: this is a fatal problem. + // we need some logging or something in here. + return nil + } + } + name, friendlySearch := utils.ConvertComponentIdIntoFriendlyPathSearch(componentId) path, err := yamlpath.NewPath(friendlySearch) if path == nil || err != nil {