-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
OpenAPI Metadata for API Endpoints #1941
Conversation
remove unused endpoint, lint fixes
def get_api_schema(): | ||
if not app_root.openapi_schema: | ||
app_root.openapi_schema = make_schema() | ||
|
||
return app_root.openapi_schema | ||
|
||
app_root.openapi = get_api_schema # type: ignore |
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.
This might need to be defined before the docs and redoc endpoints? In local testing, /api/docs
and /api/redoc
are failing to load with messages like: Not Found: /api/openapi.json
.
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.
Hm, doesn't seem to be the order, but I'm still seeing:
http://localhost:30870/api/docs
http://localhost:30870/api/redoc
Should be fixed now, got confused and removed the /openapi.json route as I thought it was unused, but it is. |
I guess it wouldn't hurt to add these routes to tests as well.. |
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.
Thanks for the fix! Tests would be good, otherwise this looks great
Could we add some padding around the logo? I assume this would have to be done within the file, yeah? |
yep, it doesn't appear that the template supports any padding, so up to us to tweak in the file unfortunately. if you want to add a different file, go ahead! |
Added simple API tests in |
- readd webhooks (regression from #1941) - set order of tags in docs - add missing tag to route
Updates the
/docs
and/redoc
API endpoints to have better metadata, including our custom favicon and our logo for the/redoc
endpoint.Based on info at:
https://fastapi.tiangolo.com/how-to/extending-openapi/
https://fastapi.tiangolo.com/tutorial/metadata/