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

allow operationId be ignored when generating operation names #2043

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

Conversation

askvortcov
Copy link

@askvortcov askvortcov commented Feb 19, 2024

Adds a CLI parameter --useOperationId, which allows using or ignoring OperationId in the swagger and relies on the path to generate operation names.

Use path placeholders to decorate operation names.

Ignoring operation ID is handy when working with a swagger generated by springdoc-openapi, since it generates messy operation IDs when confronted with multiple possibilities of Accept header.

resolves #1525

bin/index.js Outdated
@@ -19,6 +19,7 @@ const params = program
.option('--exportCore <value>', 'Write core files to disk', true)
.option('--exportServices <value>', 'Write services to disk', true)
.option('--exportModels <value>', 'Write models to disk', true)
.option('--ignoreOperationId <value>', 'Use operation id', true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.option('--ignoreOperationId <value>', 'Use operation id', true)
.option('--ignoreOperationId <value>', 'Ignore operation id', true)

Although I agree with the initial intent – make the flag opt-in and default to true to preserve current functionality

Suggested change
.option('--ignoreOperationId <value>', 'Use operation id', true)
.option('--useOperationId <value>', 'Use operation id', true)

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in the next commit. Thanks for the review.

@mrlubos
Copy link
Collaborator

mrlubos commented Feb 20, 2024

@askvortcov want to open this pull request against our fork?

@askvortcov askvortcov force-pushed the allowIgnoringOperationId branch from e8e7a31 to af4dfb7 Compare February 20, 2024 10:14
@askvortcov
Copy link
Author

askvortcov commented Feb 20, 2024

@askvortcov want to open this pull request against our fork?

@mrlubos, Done. There is a merge conflict though. If I merge it it pulls too many commits along.

@mrlubos
Copy link
Collaborator

mrlubos commented Feb 20, 2024

@askvortcov no worries, I will resolve it!

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.

OperationId - disable
2 participants