flask-openapi3 icon indicating copy to clipboard operation
flask-openapi3 copied to clipboard

Support plugins for ui templates

Open luolingchun opened this issue 1 year ago • 1 comments

Checklist:

  • [x] Run pytest tests and no failed.
  • [x] Run flake8 flask_openapi3 tests examples and no failed.
  • [x] Run mypy flask_openapi3 and no failed.
  • [x] Run mkdocs serve and no failed.

luolingchun avatar Apr 28 '24 02:04 luolingchun

Hey @luolingchun , this is working great for me!

Only suggestion would be to expose a way to override the default openapi_html_string template for the /openapi page

jaykv avatar May 02 '24 02:05 jaykv

Hey @jaykv, I agree with your suggestion.

I think more config needs to be exposed than just openapi_html_string, and I think it's a good option to use the config current_app in flask.

from flask import current_app

openapi_html_string = current_app.config["OPENAPI_HTML_STRING"]
swagger_config = current_app.config["SWAGGER_CONFIG"]
oauth_config = current_app.config["OAUTH_CONFIG"]
scalar_config = current_app.config["SCALAR_CONFIG"]

These configurations may not be used in flask-openapi3, but in flask-openapi3-plugins.

luolingchun avatar May 20 '24 03:05 luolingchun

v4.0.0rc1 has been released.

luolingchun avatar Jun 02 '24 09:06 luolingchun