Skip to content
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

Support for custom swagger-json redirect #142

Open
kylemillar608 opened this issue Nov 15, 2021 · 0 comments
Open

Support for custom swagger-json redirect #142

kylemillar608 opened this issue Nov 15, 2021 · 0 comments
Labels

Comments

@kylemillar608
Copy link

I am working on a project with a router that exposes the endpoints - "/v1/swagger-html" and "/v1/swagger-json". Running the app locally, the redirect to "swagger-json" works fine.

Issue:
When not on local machine, my app sits behind an API gateway. The url that I use to hit the "/v1/swagger-html" endpoint not on localhost is different - "example.com/dev-v1/swagger-html". Once the API gateway receives the request, it is mapped to "/v1/swagger-html" on the backend. This works, however the redirect to the swagger-json endpoint is broken. It redirects to the endpoint - "example.com/v1/swagger-json", which does not exist.

What I have tried:

  1. Changing the swaggerJsonEndpoint property to be dependent on environment. On localhost, it does not change ("/v1/swagger-json"). When deployed to dev environment, it will be "/dev-v1/swagger-json". This fixes the issue above, but leads to a new issue - the request gets past the Api gateway and the Api gateway still maps the url to "/v1/swagger-json", but now the app is exposing "/dev-v1/swagger-json". I get a 404 from the app.
  2. Adding prefix property - /dev-v1/. Again the html request works, but the redirect breaks. This time because the redirect goes to "/dev-v1/v1/swagger-json" which, again, does not exist on the Api gateway.

I need to be able to have swaggerJsonEndpoint: "/v1/swagger-json" on the app side. But, I need the redirect to go to "/dev-v1/swagger-json".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants