Open YievCkim opened 3 years ago
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}]
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 ?