Contributions
Re: Can't get url configuration to work with Swagger UI on AWS
Thanks for your reply. It's a flask app, using swagger with the help ofconnexionand deployed to AWS using Serverless Framework. By default I have no "servers" definition as the default ('/') works just fine when developing and when loading on aws (the ui loads but without the openapi.json as I described before). When I talked about setting '/dev' as the base path I set it like this: servers: - url: /dev description: Development server (uses dev data)3.2KViews0likes2CommentsCan't get url configuration to work with Swagger UI on AWS
Hi all. I'm deploying a python flask application to AWS Lambda, served through AWS API Gateway using Serverless Framework. Everything works great, except the swagger uiwhen served on AWS. Currently, my application (dev version) is deployed to some address: https://ID.execute-api.us-east-1.amazonaws.com/dev Swagger ui is indeed accessible at: https://ID.execute-api.us-east-1.amazonaws.com/dev/ui The problem is, it tries to load the openapi.json file from the root path: https://ID.execute-api.us-east-1.amazonaws.com/openapi.json instead of the relative path: https://ID.execute-api.us-east-1.amazonaws.com/dev/openapi.json If I change the "explore" URLto "/dev/openapi.json" manually at the top of the page, the UI loads, but then again, "trying out" endpoints through the UI calls endpoints at the rootinstead of the relative path: https://ID.execute-api.us-east-1.amazonaws.com/endpoint instead of https://ID.execute-api.us-east-1.amazonaws.com/dev/endpoint If I set the base path to /dev in the specification using the servers setting, the ui is no longer accessible at /dev/ui. It's then served at /dev/dev/ui. Then again, I need to change the "explore" url to /dev/dev/openapi.json and all calls are sent to /dev/endpoint instead of /dev/dev/endpoint. Am I missing something? Or does swagger uidoesn't support this use case? The only solution I can think of is deploying the apito different API Gateways, so that the basepath will always be: https://ID_DEV.execute-api.us-east-1.amazonaws.com instead of: https://ID.execute-api.us-east-1.amazonaws.com/dev3.2KViews0likes4Comments