Skip to content

Commit 7b71992

Browse files
committed
added swagger ui params
1 parent 4b3180b commit 7b71992

File tree

1 file changed

+8
-1
lines changed
  • {{cookiecutter.git_repo_name}}/{{cookiecutter.__app_name}}

1 file changed

+8
-1
lines changed

{{cookiecutter.git_repo_name}}/{{cookiecutter.__app_name}}/web_app.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,15 @@
1414
static_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'static')
1515
{% endif %}
1616

17+
# Used to config swagger UI
18+
# Reference : https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/
19+
swagger_ui_parameters = {
20+
'docExpansion': 'none',
21+
'filter': 'true'
22+
}
23+
1724
web_app = FastAPI(title='{{ cookiecutter.git_repo_name }}', version=__version__,
18-
description='{{ cookiecutter.app_description }}')
25+
description='{{ cookiecutter.app_description }}', swagger_ui_parameters=swagger_ui_parameters)
1926
web_app.include_router(example.router)
2027
{% if cookiecutter.include_webpages == "y" %}
2128
web_app.include_router(hello_world.router)

0 commit comments

Comments
 (0)