-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
@ID tag for each @Router #1095
Comments
It's not possible to describe 2 endpoints as you did in the example above. On the other hand, your proposal conflicts with OAS 2 specs and the implementation allready done here #865. operationId
Each operation may specify a unique operationId. Some code generators use this value to name the corresponding |
Thanks for the quick response. Currently, with the following example:
This double Since
|
Your last example is simple, and it can be reduced to :
Let's take the following example, which is complete CRUD:
Now, please answer the following questions, and if you think it's still a good idea, let us know.
I hope this will make clear enough why we are avoiding these shortcuts. Thanks |
Similar request: #797 |
@ubogdan Many thanks for looking into my use case in detail. In reality, there is one controller function for many routes, like To refer to your CRUD example above, I'd like to give each |
@ubogdan @YC What there ever a resolution to this? I've got the same issue where have two routers with one controller. One has a path parameter and one doesn't. When the docs are generated each show the path parameter. I'd also like to have a different summary/description for each of them if possible. |
@jwschmidt Not that I'm aware of, unfortunately. |
same issue too. finally I did this:
also, handlers changed at here: on the other hand, could we support multi annotations on one function?like this:
plus: we may need some separators other than blank lines. I hope that with swag, it would be possible to generate three distinct documents using a single function annotation |
Is your feature request related to a problem? Please describe.
When there's a controller which handles two path/routes, it would be nice to specify an ID for each route.
Currently, an expected error arises:
duplicated @id annotation 'get-user-info' found in 'GET /users/1', previously declared in: 'GET /users/me'
Describe the solution you'd like
A possible annotation is seen above or perhaps more cleanly:
With ID optionally provided for backward compatibility.
Describe alternatives you've considered
@ID
, which works without error but for a route like/api/compat/v1/{param}/...
, the autogenerated id can become quite messyAdditional context
N/A
The text was updated successfully, but these errors were encountered: