-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
Add section to docs showing how to use connexion as a Blueprint #512
Comments
Also, I am happy to submit a PR for this if the maintainers agree with this addition. |
@jasonrhaas adding a section to the docs sounds awesome! 😄 |
@jasonrhaas I don't see any reason why we would be against a PR of this nature so feel free to contribute, it's more than welcome. Just add a section of it's own so it's clear that it's Flask specific as we're trying to move Connexion to a more framework agnostic model (#380). Thanks! |
It would be great to have an example that uses blueprints. For example a regular flask web app endpoint (/) along side an API endpoint (/api). This seems like a common requirement for a typical web + mobiles + api use case. |
|
Correct me If I am wrong but by using
the
|
I needed to use the connexion_app = connexion.FlaskApp(__name__, specification_dir="./api/openapi/")
connexion_api = super(connexion.FlaskApp, connexion_app).add_api("openapi.yaml")
@connexion_api.blueprint.after_request
def after_request(response):
# your logic
return response
# Register the api blueprint
connexion_app.app.register_blueprint(connexion_api.blueprint) |
Description
It would be nice to add a section in the docs that describes how to use
connexion
using theapi.blueprint
like in #188. I think a lot of people use Flask Blueprint to manage their different endpoints, so this I think would increase adoption of theconnexion
framework.Also #393 is another reference, with an example gist.
The text was updated successfully, but these errors were encountered: