-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
✨ Add OpenAPI external_docs parameter to FastAPI
#13713
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 OpenAPI external_docs parameter to FastAPI
#13713
Conversation
external_docs is missing in FastAPI class. Added it to __init__ method to generate openapi spec
The OpenAPI class is being instantiated without the externalDocs parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cmtoro, thanks for your interest and efforts!
I think that description should be simplified.
Please review my suggestions
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
Co-authored-by: Motov Yurii <109919500+YuriiMotov@users.noreply.github.com>
remove https://commonmark.org/ reference from openapi_external_docs documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Not sure we need this parameter, but if we want to add it, then this PR effectively does it.
@cmtoro, thanks!
external_docs parameter to FastAPI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you! 🚀
This PR adds an external_docs parameter to the init method of the FastAPI class. Currently, the external_docs parameter is not being passed when generating the OpenAPI documentation, which I believe is an oversight. By including this parameter in the FastAPI class constructor, the external_docs field will be correctly included in the root of the generated OpenAPI JSON or YAML file.
Reasoning:
The external_docs field provides valuable external documentation links and should be part of the OpenAPI metadata. Including it at the root level of the OpenAPI spec enhances the usability and completeness of the generated documentation, especially for providing references to external resources.