-
-
Notifications
You must be signed in to change notification settings - Fork 772
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
Extract Swagger UI functionality into middleware #1496
Conversation
9222986
to
2980818
Compare
d286806
to
7b3f883
Compare
2980818
to
db12393
Compare
c5db83d
to
2de9894
Compare
2de9894
to
5afdf1b
Compare
5afdf1b
to
f67a8dd
Compare
Co-authored-by: Wojciech Paciorek <[email protected]>
f67a8dd
to
bbeb817
Compare
This one is ready for review @Ruwann |
Pull Request Test Coverage Report for Build 2144275390
💛 - Coveralls |
@@ -32,7 +32,83 @@ def __init__(cls, name, bases, attrs): | |||
cls._set_jsonifier() | |||
|
|||
|
|||
class AbstractAPI(metaclass=AbstractAPIMeta): | |||
class AbstractSpecAPI(metaclass=AbstractAPIMeta): |
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.
Can you add a docstring for clarity on what the purpose of this class is?
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.
Done.
We can probably remove some of these abstract API classes in the future, since they'll only be implemented for their respective middleware. For now I've kept them so it's clear which functionality is extracted from the AbstractAPI
class.
e05322a
to
f535806
Compare
Part of #1489
This PR extracts the Swagger UI functionality into a middleware.
The middleware is implemented with a starlette router on which the swagger ui endpoints are registered. For all other routes, the router acts ass a pass-through.