]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commit
✨ Add support for ASGI root_path for openapi docs (#1199)
authorIngmar Steen <iksteen@gmail.com>
Thu, 11 Jun 2020 21:53:19 +0000 (23:53 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Jun 2020 21:53:19 +0000 (23:53 +0200)
commit2f478eeca643c5c66370676cb521397479508e69
treefeef0a6d31492ab352725f2934be40b4811820cc
parent543ef7753aff639ad3aed7c153e42f719e361d38
✨ Add support for ASGI root_path for openapi docs (#1199)

* Use ASGI root_path when it is provided and openapi_prefix is empty.

* Strip trailing slashes from root_path.

* Please mypy.

* Fix extending openapi test.

* 📝 Add docs and tutorial for using root_path behind a proxy

* ♻️ Refactor application root_path logic, use root_path, deprecate openapi_prefix

* ✅ Add tests for Behind a Proxy with root_path

* ♻️ Refactor test

* 📝 Update/add docs for Sub-applications and Behind a Proxy

* 📝 Update Extending OpenAPI with openapi_prefix parameter

* ✅ Add test for deprecated openapi_prefix

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
16 files changed:
docs/en/docs/advanced/behind-a-proxy.md [new file with mode: 0644]
docs/en/docs/advanced/extending-openapi.md
docs/en/docs/advanced/sub-applications-proxy.md [deleted file]
docs/en/docs/advanced/sub-applications.md [new file with mode: 0644]
docs/en/docs/img/tutorial/behind-a-proxy/image01.png [new file with mode: 0644]
docs/en/docs/img/tutorial/behind-a-proxy/image02.png [new file with mode: 0644]
docs/en/mkdocs.yml
docs_src/behind_a_proxy/tutorial001.py [new file with mode: 0644]
docs_src/behind_a_proxy/tutorial002.py [new file with mode: 0644]
docs_src/extending_openapi/tutorial001.py
docs_src/sub_applications/tutorial001.py
fastapi/applications.py
tests/test_deprecated_openapi_prefix.py [new file with mode: 0644]
tests/test_tutorial/test_behind_a_proxy/__init__.py [new file with mode: 0644]
tests/test_tutorial/test_behind_a_proxy/test_tutorial001.py [new file with mode: 0644]
tests/test_tutorial/test_behind_a_proxy/test_tutorial002.py [new file with mode: 0644]