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
Add description to tags #1106
Comments
Hi @Ismael you can achieve it with openapi_extra: api = NinjaAPI(
openapi_extra={ # < ------
'tags': [
{
'name': 'tag1',
'description': 'Some description goes here',
}
]
}
)
@api.post("/hello", tags=["tag1"])
def hello(request):
return {'hello': 'World'}
technically it's a global record on the whole swagger doc - so I guess it make sense to define it on the NinjaAPI level |
Yes, the feature request is to have a "nicer"? way to do it. Or maybe just document how it's done? The docs make it sound like using openapi_extra would be to add "weird" stuff. I wasn't that familiar with the spec to know that that was the spot to define tag descriptions. |
Currently the only way to add a description to the tags is to include them manually as "openapi_extra" at the NinjaAPI constructor like so:
It would be ideal to be able to add the description to a Router. Something like this maybe:
Or also support externalDocs:
Reference:
https://swagger.io/docs/specification/grouping-operations-with-tags/
The text was updated successfully, but these errors were encountered: