-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template parameters not allowed in query part of URL (OpenSearch-like) #1054
Comments
(Disclaimer, these are user comments not official OAS opinion.) The key of an OAS The template parameter you discuss attaches meaning to the value (or position in a hypothetical template) of a querystring parameter, not its name. There is nothing stopping you creating a specification (vendor) extension similar to your As to your second point, where it pertains to enums, see this issue and linked issues. |
Thanks for these useful references about similar questions. The tools that interpret these extensions (that currently interpret OpenSearch parameters in XML-based OSDD documents) are Client applications by space agencies like NASA and ESA and others that take such OSDD as input and propose a user interface to the user to search for satellite images, e.g. NASA CWICSmart. We could indeed create a specification, let's say OpenAPI OpenSearch Extension, grouping together a number of vendor extensions needed to obtain a JSON equivalent of an OSDD, e.g. Is there a kind of repository for such extensions for OpenAPI where they all can be found together ? and a standard way or template to define them ? E.g. OpenSearch 1.1 has also extensions and publishes them here for the interested users. |
This was discussed here, to summarise: not really, and not yet.
I think the problem would be how to communicate / format that specification extension property. Some documentation tools (e.g. my own widdershins) take a template-based approach so can be extended to cover extensions, others may allow plugins to handle extensions. I've collated a list of documented specification (vendor) extensions here but a proper repository a la OpenSearch or Schema.Org and/or a standard template would be great next steps. |
This sort of thing is being addressed in OAS 4 Moonwalk as part of the operation signatures principle. Please join the discussions in that repository if you are still interested! |
Dear all,
I have to say first of all that the specification is very interesting (we only discovered it recently) and we are looking forward for tool support to be aligned with this new version and apply it in current and future projects.
I wonder if the OAI specification could cover use cases for which today in our domain (Earth Observation) OpenSearch [1] Description Documents (OSDD) are used. This would require path templating also to be allowed in the query part or associating an actual parameter with the OpenSearch parameter.
We are currently relying heavily on OpenSearch 1.1 [1] and Parameter Extension of OpenSearch [2] for defining API, but the tendency now is to migrate this XML-based solution to a JSON equivalent and OAI comes very close...
The OSDD allows for URL templates like
template="http://example.com/search?q={searchTerms}"
, and only the parameter names between the {} are standardised by OpenSearch or related Open GeoSpatial Consortium specifications such as OGC 10-032r8 or OGC 13-026r8. Implementations are free to choose actual query parameter names.For an OpenAPI description to be an alternative for an OSDD, it would be useful to be able to associate the actual query/path parameter names with their OpenSearch definition, thus associate
q
withsearchTerms
in the example. For the path parameters (in: path
), this is already possible. However, for parameters which appear after the "?" (in: query
), this is not allowed.Either allowing in OAI to have paths with a query part with template parameters (which is similar to the
x-ms-paths
notation from Microsoft Azur [3]):Alternatively, if extending the "path templating" cannot be envisaged, an association between
q
andsearchTerms
as in the OpenSearch Parameter Extension [2] could be done with a property such asx-value
as below:Another feature on our wishlist is to be able to distinguish values in enumerations (but also normal query parameter) from the way user interfaces would present them to users, e.g.
the Parameter Extension of OpenSearch uses:
In OAI, there is no way to associate a "label" and it becomes:
Have OpenSearch like "templating" capabilities been considered or could be envisaged? The current space Earth Observation community (e.g. CEOS [4]) which has invested a lot in the OpenSearch-like technology would then have a clear migration path to JSON/OAI while preserving the effort which went in defining the OpenSearch extensions with specific parameters for this domain....
regards,
Yves.
References used above:
[1]: http://www.opensearch.org/Specifications/OpenSearch/1.1
[2]: http://www.opensearch.org/Specifications/OpenSearch/Extensions/Parameter/1.0/Draft_2
[3]: https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/creating-swagger.md
[4]: http://ceos.org/ourwork/workinggroups/wgiss/access/opensearch/
The text was updated successfully, but these errors were encountered: