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
swagger-servlet generating non-unique operationIds #1512
Comments
I believe the bug is that the field is used for path generation (if it's indeed used for that). Keeping the operationId/nickname unique is up to the user when it comes to servlets. |
just being curious - do you have another field in mind? currently, the method name is implemented as fallback if nickname is not set but that bears the same problem of being non-unique (across resources at least, ref. https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-servlet/src/main/java/io/swagger/servlet/extensions/ServletReaderExtension.java#L224). |
You mean a fallback for the operationId generation? When it comes to servlets, it has to be the user responsibility. That said, the fallback should be to leave the operationId empty if it's a servlet, as the operationId in 2.0 is not a mandatory field. By the way, thank you for providing the feedback on this module. @iushankin has done intense work on it! However, any initial release would have bugs in it and so opening tickets would really help us push a more stable module in the future. |
yes i meant as fallback for operationId "generation" or rather which annotation attributes could/should be used for path and/or operationId if those are handled seperately. did not know operationId is optional, so defaulting to an empty value is fine of course. side-note reg. the migrated swagger-servlet module: currently using it successfully without jax-rs which means it is already working as i requested in #919. just awesome. |
Okay, so we'll need to fix that point. The |
Fix #1512 - nickname not to be considered for path
using swagger-servlet-1.5.4.
first of all, @iushankin huuuge thanks for swagger-servlet migration with 1.5.4! works almost flawlessly.
i noticed that swagger-servlet will use
@ApiOperation
snickname
attribute for path generation as well as foroperationId
.however, it may be necessary to have multiple operations with the same path (but different http methods).
in this case, the
nickname
is correctly used multiple times as path for different operations but also asoperationId
which means theoperationId
is no longer unique.as a result, swagger editor - for example - shows errors:
thanks, zyro
The text was updated successfully, but these errors were encountered: