Closed danionescu0 closed 1 year ago
This might be a bug, I would have expected the paths to be correct, i.e. including the prefixes, as output in the schema. Is this not the case?
The code above will print output like: <class 'function'> ['annotations', 'call', 'class', 'closure', 'code', 'defaults', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'get', 'getattribute', 'globals', 'gt', 'hash', 'init', 'init_subclass', 'kwdefaults', 'le', 'lt', 'module', 'name', 'ne', 'new', 'qualname', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook'] ... ... Which won't give me the actual route
My question is can i get for every function that i loop in this code:
func = app.view_functions[rule.endpoint]
# func will be smth like <function get_profile at 0x7fc8da3f1d30>
the actual route ex: "/v2/profiles" ?
The view function looks like this:
profile_bp = Blueprint('profile_bp', __name__)
@profile_bp.route('/v2/profiles', methods=['GET'])
@tag(["PROFILE"])
async def get_profiles():
...
for example:
func.get_actual_route() # which should be "/v2/profiles"
I don't think I understood this. Closing due to time elapsed (probably fixed).
Hello there.
I have a question about this package. In have some specific usecase about the generation of openapi.json and i'm trying to override "_build_openapi_schema" function in extension.py I am working on an app that uses nested blueprints, i want to know for every view function :
What is the parent blueprint to extract the url_prefix from it and add the prefix to the documentation in some way.
Now i am having some trouble getting this information, i've tried looping through the blueprints, my code looks like this:
but i'm getting the "deferred_functions", now i need to match the "func" from my fist code block, with the "def_fun" and i don't know how to do that.
I would appreciate any hint you could give me, thank you!