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 #865

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

yuhaibohotmail
Copy link

@yuhaibohotmail yuhaibohotmail commented Nov 21, 2024

Many thanks for submitting your Pull Request ❤️!

Please make sure that your PR meets the following requirements:

  • 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".

In this PR, we add a config properties remove-operation-id-prefix,to delete class name from operationId.

@yuhaibohotmail yuhaibohotmail requested a review from a team as a code owner November 21, 2024 23:36
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.

I need help finding what this PR is doing. I'm only seeing an introduction of a property to the generator. What do you do with it after? Or is this something that the underlying generator already takes care of? If so, please add a reference.
Can you also please add some tests under the integration-tests module?

import static io.quarkiverse.openapi.generator.deployment.CodegenConfig.ConfigName.MODEL_NAME_SUFFIX;
import static io.quarkiverse.openapi.generator.deployment.CodegenConfig.ConfigName.TEMPLATE_BASE_DIR;
import static io.quarkiverse.openapi.generator.deployment.CodegenConfig.ConfigName.VALIDATE_SPEC;
import static io.quarkiverse.openapi.generator.deployment.CodegenConfig.ConfigName.*;
Copy link
Member

Choose a reason for hiding this comment

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

Please don't use star imports.

@@ -88,6 +88,13 @@ quarkus.openapi-generator.codegen.spec.petstore_json.model-name-suffix=CustomMod
quarkus.openapi-generator.codegen.spec.petstore_json.model-name-prefix=CustomModelPrefix
----

You can customize the name of generated method. To do that, you must define the following properties:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You can customize the name of generated method. To do that, you must define the following properties:
You can customize the name of the generated method. To do that, you must define the following properties:

Can you please elaborate a bit more this doc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Requires remove operationid prefix
3 participants