-
Notifications
You must be signed in to change notification settings - Fork 22
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
auto-generated openapi doc wrong url in swagger ui #55
Comments
I looked into swagger.py and I propose to do that instead at l-143: from quant import request
# ...
spec = {
'openapi': '3.0.0',
'info': infos,
'servers': [
{
'url': request.root_url or ''.join([scheme, '://', self.api.config['SERVER_NAME'] or ''])
}
],
'paths': paths,
'components': components
} |
This is an annoying bug, @MikHulk 's solution should work For now, here is my workaround @app.before_first_request
async def setup():
app.__schema__ # ensure _schema property is set
app._schema['servers'] = [{'url': request.root_url}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Here my openapi schema:
I added a html template file to serve swagger-ui in my project:
Everything work as expected but "try it out" button doesn't work because it try to perform request against
http://mydomain/openapi.json/trolls
instead ofhttp://mydomain/trolls
as expected.I tried to find in swagger-ui documentation how to specify the base_url. But i didn't find something to do that. I am not sure my issue related to quart-openapi or a misconfiguration on swagger-ui.html.
Is there something to specify the base_url to test for swagger-ui ? Is there an information I have to provice in openapi.json or in SwaggerUIBundle ?
The text was updated successfully, but these errors were encountered: