Extract Swagger UI functionality into middleware (#1496)

* Extract swagger UI functionality from AbstractAPI

* Extract Swagger UI functionality into middleware

Co-authored-by: Wojciech Paciorek <arkkors@users.noreply.github.com>

* Add additional docstrings

Co-authored-by: Wojciech Paciorek <arkkors@users.noreply.github.com>
This commit is contained in:
Robbe Sneyders
2022-04-10 17:15:27 +02:00
committed by GitHub
parent 895d3d475a
commit 41c19c1127
10 changed files with 335 additions and 177 deletions

View File

@@ -59,7 +59,7 @@ def test_openapi_yaml_behind_proxy(reverse_proxied_app):
headers=headers
)
assert openapi_yaml.status_code == 200
assert openapi_yaml.headers.get('Content-Type') == 'text/yaml'
assert openapi_yaml.headers.get('Content-Type').startswith('text/yaml')
spec = yaml.load(openapi_yaml.data.decode('utf-8'), Loader=yaml.BaseLoader)
if reverse_proxied_app._spec_file == 'swagger.yaml':