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

Conflict between TagActionsBy and [SwaggerTag(...)] #2618

Open
tyler-boyd opened this issue Mar 14, 2023 · 2 comments
Open

Conflict between TagActionsBy and [SwaggerTag(...)] #2618

tyler-boyd opened this issue Mar 14, 2023 · 2 comments
Labels
help-wanted A change up for grabs for contributions from the community

Comments

@tyler-boyd
Copy link
Contributor

tyler-boyd commented Mar 14, 2023

Environment

.NET 7.0
Swashbuckle.AspNetCore: 6.5.0

Issue

Possibly related to #2160

I can use options.TagActionsBy(...) to customize the tag names for an operation.
However, if I also use the [SwaggerTag(...)] attribute on the operation, then it will create a new tag in the swagger tags section using the default name (controller name) and apply the description there, leading to empty tag sections on the swagger UI. This behaviour appears to be due to how AnnotationsDocumentFilter works (it doesn't look at swaggerGenOptions.SwaggerGeneratorOptions.TagsSelector at all).

Ideally, that filter would apply the tag descriptions to the tag specified by TagActionsBy, instead of the default (controller name).

Not a major issue, but it's a bit unfortunate that these two features don't work together.

@cadmaticpgustafsson
Copy link

I have the same problem, does anybody know of a workaround? Is it possible to something like a SwaggerSchemaFilter for controllers?

@pablokawan
Copy link

Same problem here, im trying to add a description to my controller using SwaggerTag but this implies in a new swagger section

@martincostello martincostello added the help-wanted A change up for grabs for contributions from the community label Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help-wanted A change up for grabs for contributions from the community
Projects
None yet
Development

No branches or pull requests

4 participants