-
Notifications
You must be signed in to change notification settings - Fork 6
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
Setting the API Server URL bug in Docker container #9
Comments
Issue with Connexion default behavior. Multiple issues have been created but the default behavior is to override spec-first/connexion#1174 The culprit: https://github.com/zalando/connexion/blob/master/connexion/apis/flask_api.py#L310 It can be solved by adding a param to disable An
Then check it in |
Using https://pypi.org/project/flask-reverse-proxy-fix/ can help solve the issue requirements.txt:
Code: from flask_reverse_proxy_fix.middleware import ReverseProxyPrefixFix
api = connexion.App(__name__, options={"swagger_url": ""}, arguments={'server_url': server_url})
api.add_api('openapi.yml')
api.app.config['REVERSE_PROXY_PATH'] = 'http://api.collaboratory.semantiscience.org'
ReverseProxyPrefixFix(api.app)
api.run(host='0.0.0.0', port=port, debug=debug, server=deployment_server) |
Great! but the server url is misspelled . |
Yep it works with absolute URIs and relative paths(e.g. Going to try it with Smart API |
Smart API still not working even with absolute URL: https://smart-api.info/ui/ff8e602615d19577fa3759240dcce951 |
The
servers
url in the OpenAPI yaml definition is not changed by the provided arguments only when run in Docker containersThe exact same command:
openpredict start-api --server-url http://myurl
Works fine locally, the server URL is updated in the OpenAPI definition exposed
When run as entrypoint of a Docker... For some reason the arg is properly passed to the Python code, and the API is well started by the following line (with the right
server_url
):But for some reason the started API has en EMPTY servers URL (not even a
/
which should be the default)Seems to be an issue with Connexion
The text was updated successfully, but these errors were encountered: