Closed hugoboos closed 10 months ago
I will look into fixing the search scope; thanks for finding this.
This has been resolved in v0.13.0
with the release of the rolodex. All indexes are now kept correctly against virtual filesystems. No more scope mixing for searches
When building a document with the following spec:
The ogc-api-tiles file (reduced to show only the relevant parts):
With
0.5.2
the resolver couldn't findTileMatrixSetIdLink
component when resolving thetileMatrixSets
schema. With0.6.0
this is fixed. But I found that the resolver is searching out of scope for a reference. It is searching in all the child indicies.So when the resolver is searching the (root) index for
#/components/schemas/TileMatrixSetIdLink
(https://github.com/pb33f/libopenapi/blob/1ac5fbe9fca9a80b80bf484c5784e776425a3d58/resolver/resolver.go#L347) it won't find it inallMappedRefs
orexternalSpecIndex
because the keys of those maps are prefixed withhttps://api.swaggerhub.com/domains/UAB-CREAF/ogc-api-tiles/1.0.0
. Eventually it will find it in one of thechildren
.When
TileMatrixSetIdLink
is unique across all the external specifications this is not a problem. But when it is not, you can get a reference from another external spec.The resolver should only use the index of the external spec to search for references and not search out of scope.