Skip to content

Commit

Permalink
feat: Allow using custom Swagger template for SwaggerView. (#1639)
Browse files Browse the repository at this point in the history
  • Loading branch information
piffall authored Jun 9, 2021
1 parent 1ff2283 commit 8fe7872
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ Use config.py to configure the following parameters. By default it will use SQLL
+----------------------------------------+--------------------------------------------+-----------+
| FAB_API_SWAGGER_UI | Enables a Swagger UI view (Boolean) | No |
+----------------------------------------+--------------------------------------------+-----------+
| FAB_API_SWAGGER_TEMPLATE | Path of your custom Swagger Template | No |
+----------------------------------------+--------------------------------------------+-----------+
| FAB_API_ALLOW_JSON_QS | Allow query string parameters to be JSON | |
| | Default is True (Boolean) | No |
+----------------------------------------+--------------------------------------------+-----------+
Expand Down
4 changes: 3 additions & 1 deletion flask_appbuilder/api/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ class SwaggerView(BaseView):
@has_access
def show(self, version):
return self.render_template(
"appbuilder/swagger/swagger.html",
self.appbuilder.app.config.get(
"FAB_API_SWAGGER_TEMPLATE", "appbuilder/swagger/swagger.html"
),
openapi_uri=self.openapi_uri.format(version),
)

Expand Down

0 comments on commit 8fe7872

Please sign in to comment.