-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Names of derived methods are ending with numbers (Java + Spring) #6173
Comments
Update: The situation even worse than I though initially. It not related to polymorphism, but rather to multiple defined Dockets. Let's assume I have API v1 and API v2. I want to show documentation for both versions, so I defining two Dockets, each one with different group name:
Obviously, since its two versions of same API, there could be methods with same names in both Dockets. So, when I generating code based on "v1" using this command:
you producing incorrect method names ending with numbers, probably because in you think there is collision in names. But there isn't! You should analyze only selected APIs for generation, not all injected Dockets. P.S. reproduced this issue in versions 4.3.0, 4.2.3 |
I fixed it with overriding OperationNameGenerator:
|
Let's assume I have the following controller of version 1 (Java + Spring):
Which generated into something like this:
Now, I decided to expose new API which extends the existing one:
When I generating code based on those two controllers I got generated both MyControllerV1 and MyControllerV2 (as expected). MyControllerV1 is the same as previously, but MyControllerV2 looks like this:
The expected: derived class will have exactly same method names as the base one.
The actual: derived class has its derived methods ending with numbers.
The whole idea of deriving approach is to extend existing API with less breaking changes as possible. Now everyone who migrates to MyControllerV2 has to rename all existing methods.
This is very annoying. I not sure if is this bug or feature, but is there anything I can do to get desired behavior? Or this is indeed bug?
The text was updated successfully, but these errors were encountered: