Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plugins for ui templates #151

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Support plugins for ui templates #151

wants to merge 5 commits into from

Conversation

luolingchun
Copy link
Owner

@luolingchun luolingchun commented Apr 28, 2024

Checklist:

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

@luolingchun luolingchun force-pushed the plugins branch 3 times, most recently from 73b9cb0 to b082246 Compare April 28, 2024 08:41
@luolingchun luolingchun mentioned this pull request Apr 28, 2024
8 tasks
@jaykv
Copy link

jaykv commented May 2, 2024

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

@luolingchun
Copy link
Owner Author

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
Copy link
Owner Author

v4.0.0rc1 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants