-
-
Notifications
You must be signed in to change notification settings - Fork 523
v3/api-docs/swagger-config endpoint without 'url' value #1698
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
Comments
When you use, config url:
Either, set |
@Jaswine on our deployed app, we using proxy to call api, |
If you're using a reverse proxy sever, check it out: |
@SMore-Napi i tried this, still no luck, it still called https://xyz.com/v3/api-docs/swagger-config in ui |
I have similar issue, my application is multitenant thus the url of swagger UI is https://{tennantName}.mycompany.com/{tenantId}/applicationName/swagger-ui/index.html. Because the tennant info is dynamic, we cannot statically define config-url in properties files. We though we can pass the configUrl as request params but it seem swagger-initializer.js always load it from a default place. |
is there any solution for this. i am also facing same issue as my application is deployed on kubernetes with istio and im not able to append UriPrefix to the request which is being made by swagger. |
I ended up customize the swagger-initializer.js to extract the context path from the url to form the correct api-docs (HTTPS://tenant.mycompany.com/tenantName/applicationName/v3/api-docs) then in the SwaggerUIBundle I set the url to that. |
@lnthai2002 can you please elaborate how you customized swagger-initializer.js, and SwaggerUIBundle? |
Here is my customized sawgger-initalizer.js:
As you can see, I craft the configUrl using the current URL, the configUrl is formed by taking the context of the app which includes the tenant info and then affixed by a path to the location of the swagger spec file for the tenant. When the swagger UI starts, it will first fetch the spec from this configUrl and then render it.
|
hi,developer
Describe the bug
i hava the problem with use springdoc and springboot.
springdoc work correctly in local env , but is not work on server.
local env:
http://localhost:8080/user/swagger-ui/index.html
server env
https://my-domain.com/**sup-user**/user/swagger-ui/index.html
the sup-user is a path mapping
To Reproduce
Steps to reproduce the behavior:
springboot version:2.6
springdoc version:1.6.8
json
config is following:
Expected behavior
Screenshots
If applicable, add screenshots to help explain your problem.
local env:

server env:

while i insert '/sup-user/user/v3/api-docs' on top of swagger-ui page ,then click 'Explore', i can get all apis info.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: