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
[#17] Support for Nested APIBlueprint enhancement #18
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
Hey @luolingchun, I have been working with your patch for the most of the week, and it seems to work, the only thing I have found is the order of when one does what is important, but if stuff is done in the right order, it works :D Maybe it makes sense to have a way to do call-backs. E.g. if I add an endpoint from flask_openapi3 import APIBlueprint
parent = APIBlueprint(name="parent", import_name=__name__, url_prefix="/parent")
child = APIBlueprint(name="child", import_name=__name__, url_prefix="/child")
@child.post(rule="endpoint_1", responses={"204": MsgResponse, "400": ErrorMsgResponse})
def endpoint_1(body: PostRequest):
return {"msg": "test msg"}
parent.register_api(child)
@child.post(rule="endpoint_2", responses={"204": MsgResponse, "400": ErrorMsgResponse})
def endpoint_2(body: PostRequest):
return {"msg": "test msg"} |
@dvaerum There is the same problem in Flask, Therefore, I think we should solve this problem by ourselves when coding. from flask import Flask, Blueprint
app = Flask(__name__)
bl = Blueprint('test', __name__)
@bl.route('/route1')
def route1():
return 'Hello, World!'
app.register_blueprint(bl)
@bl.route('/route2')
def route2():
return 'Hello, World!'
if __name__ == '__main__':
print(app.url_map)
|
Sounds completely fair 👍 |
@luolingchun I have been using this patch of yours for some time now and still have not found any problems with it 👍 Just want to give you an update 😃 |
29feeba
to
8890337
Compare
56f7e17
to
03c351a
Compare
Support for Nested APIBlueprint enhancement