Skip to content
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

remove operation id prefix #873

Merged

Conversation

yuhaibohotmail
Copy link
Contributor

@yuhaibohotmail yuhaibohotmail commented Nov 27, 2024

  • You have read the contributors guide
  • Your code is properly formatted according to our code style
  • Pull Request title contains the target branch if not targeting main: [0.9.x] Subject
  • Pull Request contains link to the issue
  • Pull Request contains link to any dependent or related Pull Request
  • Pull Request contains description of the issue
  • Pull Request does not include fixes for issues other than the main ticket

Fix #866

When use smallrye openapi operationid strategy CLASS_METHOD,operationId fields take the form of "class_name_method". For example, "User_findAll". We want remove operationId prefix (e.g. User_findAll=> findAll)

In this PR, we add a config properties remove-operation-id-prefix,to delete class name from operationId. The properties are passed to the openapi-generator, and the specific functions are executed by the openapi-generator.

https://github.com/OpenAPITools/openapi-generator/blob/4c5a57fe7bae59483bb8fa9218be8dc4f82e1bda/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L5638

@yuhaibohotmail yuhaibohotmail requested a review from a team as a code owner November 27, 2024 14:56
@yuhaibohotmail
Copy link
Contributor Author

@ricardozanini @ricardozanini
Sorry I messed up my commit, so I rebuilt this PR.

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an unusual use case; many thanks for bringing this to our attention and sending the PR.

Now, with the test, it makes much more sense.

yuhaibohotmail and others added 2 commits November 28, 2024 20:24
…va/io/quarkiverse/openapi/generator/it/RemoveOperatiionIdPrefixTest.java

Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
…va/io/quarkiverse/openapi/generator/it/RemoveOperatiionIdPrefixTest.java

Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
@ricardozanini ricardozanini merged commit 2711260 into quarkiverse:main Nov 29, 2024
7 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 29, 2024
hbelmiro pushed a commit that referenced this pull request Nov 29, 2024
Co-authored-by: yuhaibohotmail <48646226+yuhaibohotmail@users.noreply.github.com>
@yuhaibohotmail yuhaibohotmail deleted the remove-operation-id-prefix branch November 29, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Requires remove operationid prefix
3 participants