You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We would like to use connexion with Flask to serve multiple API using distinct Swagger YAML files that all use the same base path.
Example :
file1.yaml
-> contains route /api/v1/statistics
file2.yaml
-> contains route /api/v1/products
In order to do this, we are calling the add_api method with each Swagger YAML file.
Expected behaviour
Both file are parsed and every routes are served through connexion/Flask.
Actual behaviour
An error occurs because Blueprint name conflicts as they are computed using base_path which is :
file1.yaml -> /api/v1
file2.yaml -> /api/v1
As a workaround, we replace the add_api call by function that mimic add_api but allow to pass additional **options to the register_blueprint methods.
Instead of :
The options you mention are framework specific, while we try to keep the connexion interface framework agnostic. Other frameworks support a name parameter as well though (eg starlette), so I would not be opposed to adding the name parameter to the add_api method.
Description
We would like to use connexion with Flask to serve multiple API using distinct Swagger YAML files that all use the same base path.
Example :
file1.yaml
-> contains route /api/v1/statistics
file2.yaml
-> contains route /api/v1/products
In order to do this, we are calling the
add_api
method with each Swagger YAML file.Expected behaviour
Both file are parsed and every routes are served through connexion/Flask.
Actual behaviour
An error occurs because Blueprint name conflicts as they are computed using base_path which is :
file1.yaml -> /api/v1
file2.yaml -> /api/v1
Steps to reproduce
Same as 1032
Additional info:
As a workaround, we replace the
add_api
call by function that mimicadd_api
but allow to pass additional **options to theregister_blueprint
methods.Instead of :
We do :
Is there any reason to not add
add_api
**options parameters that could be given back toregister_blueprint
method ?Output of the commands:
python --version
=> Python 3.7.5pip show connexion | grep "^Version\:"
=> Version: 2.12.0Thanks in advance for your help.
Yours faithfully,
Antoine
The text was updated successfully, but these errors were encountered: