Support for semantic path templating
See original GitHub issueHi,
I recently ran into the following issue: I have two different types of URIs which support different requests (verbs) and return different values. I tried to write them down as:
paths:
/{CollectionURI}:
get:
summary: List Collection Members
...
post:
summary: Create a Resource
...
parameters:
- $ref: "#/parameters/CollectionURI"
/{MemberURI}:
get:
summary: Retrieve a Resource
...
parameters:
- $ref: "#/parameters/MemberURI"
…which does show up fine in Swagger-UI but is not officially supported. Swagger-Editor doesn’t like it and shows an error.
I asked that question on SO: https://stackoverflow.com/questions/35478531/swagger-equivalent-path-already-exists-despite-different-parameters
Please add support for this kind of path templating in the next version.
Thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:27 (16 by maintainers)
Top Results From Across the Web
Paths and Operations - Swagger
A single path can support multiple operations, for example GET /users to get a list of users and POST /users to add a...
Read more >Using Templates - OpenAPI Generator
OpenAPI Generator supports user-defined templates. This approach is often the easiest when creating a custom template. Our generators implement ...
Read more >Configure semantic search - Azure - Microsoft Learn
Add a semantic configuration to an index; Add parameters to a query request. Prerequisites. A search service on Standard tier (S1, S2, S3)...
Read more >Handlebars
Handlebars provides the power necessary to let you build semantic templates effectively with no frustration. Mustache-compatible. Handlebars is largely ...
Read more >Path parameter in the path has no corresponding path template
Issue ID: semantic-parameter-nopathtemplate ... Make sure that all path parameters have corresponding path templates, or remove the parameters that do not ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately this is supported in different server frameworks by routing the request based on regexes on the path parameters. I am not saying we should support it but it is somewhat common.
Declaring the regex in the path parameter in the path makes this more tolerable but you still have to deal with the order of the routing, etc
Still seems to be a problem in 2022… Servers can route different data types very nicely, hence: GET /resource/{byUUID} and GET/resource/(byString} and GET /resource/{byInt} can all be handled quite easily by most servers.