-
Notifications
You must be signed in to change notification settings - Fork 942
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
Tags within api definition are not unique #1633
Comments
I think this is a mixture of two different things and perhaps some confustion about what the The This you would define once at the top level, perhaps nested/next to your #[OA\OpenApi(tags=[
new OA\Tag(name: 'v1', description: 'Part of V1'),
new OA\Tag(name: 'v2', description: 'Part of V2'),
new OA\Tag(name: 'product', description: 'Part of the Product API'),
new OA\Tag(name: 'user', description: 'Part of the User API'),
]) Further down in your controllers you'd add tags to your HTTP operations, just using the name. #[OA\Get(path: '/api/products', tags: ['v1', 'product'])
class GetProductsController { ... } So, in your example you are just defining the tag over and over without actually tagging endpoints. I would think that the bundle has some rules for how that is happening? Having said that, maybe there should be de-duplication of global tags too :) |
Thank you for clarifying and providing the deduplication. Tahnk you! Best regards, Edit: here's the link for the documentation, just if someone is interested: |
Hi,
when having the same tag for multiple methods / routes the resulting api definition has the same tag multiple times but the specification says that tag names must be unique.
Within the specification for the
tags
within the OpenAPI object, the OpenAPI specification says:Perhaps I'm doing something wrong?
Example class:
this results in a tag list like this:
but imho it should result in a tags list like this:
Best regards,
Matthias
PS: the original issue was posted in nelmio/NelmioApiDocBundle#2308 but it was sorted out, that this was the wrong project
The text was updated successfully, but these errors were encountered: