You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back in the days of SpringFox, there were several requests to be able to change and/or disable the unique suffixes appended to the operationIds. While there were a few workarounds, the option to completely disable all suffixes never materialized.
The main issue is when multiple RestControllers follow the same naming convention for methods. For example, if I have multiple getById() methods, they will receive a suffix number when generated. For example, getById() might become getById_5 as an operationId. This happens even if the different getById() methods exist in different controllers.
These suffixes become a problem when using a code generator such as openapi-generator (https://openapi-generator.tech/). Even if generating to a unique class in strongly typed language like TypeScript, the method is still named after the operationId, with the suffix. Upon subsequent compiles and deploys, that number might change, which forces the API consumers to alter their code.
I may have missed something in how to avoid this, or perhaps there is a new solution, but I feel the easiest would be to have a property to disable the unique suffix.
Suffixes are only generated to have unique operations names in the generated spec.
If you want to avoid it, you can rename your non-unique operation names.
Back in the days of SpringFox, there were several requests to be able to change and/or disable the unique suffixes appended to the operationIds. While there were a few workarounds, the option to completely disable all suffixes never materialized.
The main issue is when multiple RestControllers follow the same naming convention for methods. For example, if I have multiple
getById()
methods, they will receive a suffix number when generated. For example,getById()
might becomegetById_5
as an operationId. This happens even if the differentgetById()
methods exist in different controllers.These suffixes become a problem when using a code generator such as openapi-generator (https://openapi-generator.tech/). Even if generating to a unique class in strongly typed language like TypeScript, the method is still named after the operationId, with the suffix. Upon subsequent compiles and deploys, that number might change, which forces the API consumers to alter their code.
I may have missed something in how to avoid this, or perhaps there is a new solution, but I feel the easiest would be to have a property to disable the unique suffix.
Links for historical context.
springfox/springfox#1224 (comment)
https://stackoverflow.com/a/38828012/203498
The text was updated successfully, but these errors were encountered: