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

Fix default tag logic for paths #1002

Merged
merged 1 commit into from
Aug 24, 2024
Merged

Fix default tag logic for paths #1002

merged 1 commit into from
Aug 24, 2024

Conversation

juhaku
Copy link
Owner

@juhaku juhaku commented Aug 24, 2024

The default tag for paths is resolved from the module path of the handler or OpenApi if the type in question is a nested OpenApi document. This was supposed to be only the case when no additional tags are provided for the paths. However it was resolved in all cases and there was no way to "not to use" module path as a tag. This commit fixes this and the module path will be only used if there are no other tags defined.

This commit also changes the old behavior where crate was used as a tag in case there was no module path available. From now on if there is no module path there will be no default tag added to any of the paths. This will result the paths to be rendered under default tag in a Swagger UI.

Fixes #978 Fixes #955

The default tag for paths is resolved from the module path of the handler
or `OpenApi` if the type in question is a nested `OpenApi` document. This
was supposed to be only the case when no additional tags are provided for the
paths. However it was resolved in all cases and there was no way to
"not to use" module path as a tag. This commit fixes this and the
module path will be only used if there are no other tags defined.

This commit also changes the old behavior where _`crate`_ was used as
a tag in case there was no module path available. From now on if there is
no module path there will be no default tag added to any of the paths.
This will result the paths to be rendered under _`default`_ tag in a
Swagger UI.

Fixes #978
@juhaku juhaku added the bug Something isn't working label Aug 24, 2024
@juhaku juhaku merged commit f2a7143 into master Aug 24, 2024
16 checks passed
@juhaku juhaku deleted the fix-default-tags-for-paths branch August 24, 2024 19:22
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Paths are always assigned to a tag with their module path Default tag does not get overriden.
1 participant