-
Notifications
You must be signed in to change notification settings - Fork 31
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
swagger-ui-py >="21.9.28" adds the "/api/doc/" on every URL of an api call #33
Comments
tropxy
changed the title
swagger-ui-py =="21.10.15" and quart_open_api="1.7.2" seem to not be compatible
swagger-ui-py >="21.9.28" adds a bug on when doing an api call
Nov 28, 2021
tropxy
changed the title
swagger-ui-py >="21.9.28" adds a bug on when doing an api call
swagger-ui-py >="21.9.28" adds the "/api/doc/" on every URL of an api call
Nov 28, 2021
@tropxy Can you try this?
|
Sorry, I havent realized you answered me... I will try soon your suggestion, thank you! |
Hi, any updates on this? |
@tropxy Do you have a demo to reproduce the problem? |
@tropxy You should write it like this @app.route("/api/doc/swagger.json")
async def openapi():
config = app.__schema__
for server in config.get('servers', []):
server['url'] = 'http://localhost:8080'
return jsonify(config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, first let me thank your for coming up with this lib ;)
And before coming to the issue, here are my env settings:
I am generating the swager.json using quart-openapi and here is how my code looks like:
when I run the project, locally, and access the url :
http://localhost:8080/api/doc/
, the page is generated correctly, with all the endpoints I created. The problem is, once I try out one of the endpoints, the URL that the page tries to hit is incorrect.Instead of trying
http://localhost:8080/sites
it is tryinghttp://localhost:8080/api/doc/swagger.json/sites
and I cant figure out what settings shall modify to make it work again.[EDIT]
I did a bit of a research and found out that the problem only occurs from version 21.9.27.post1 on; on versions 21.9.27 and below, it still works as expected. I hope this helps finding the issue...
Thanks!
The text was updated successfully, but these errors were encountered: