You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experiencing an issue with Swagger UI not properly recognizing the context path in a Spring Boot 3 application deployed behind an API gateway. The application works correctly locally and functioned as expected in Spring Boot 2. However, when deployed on a server with the API gateway, Swagger UI intermittently fails to load the configuration, especially when accessed from different operating systems.
try {
m = await (s.userFetch || fetch)(s.url, s),
m = await Ju.serializeRes(m, i, s),
s.responseInterceptor && (m = await s.responseInterceptor(m) || m)
}
Environment:
Spring Boot version: 3.x.x2.6.0[insert your version]
Operating Systems tested: macOS, Windows
API Gateway: Gravitee.io
Steps to Reproduce:
Deploy the Spring Boot application behind an API gateway on a server.
Access Swagger UI from a macOS device and confirm it loads correctly with the context path set to /myContextPath.
Access the same Swagger UI from a Windows device, which fails with the error "Failed to load remote configuration."
After this, access from macOS again, and it now also shows the same error.
Expected Behavior:
Swagger UI should consistently recognize and load the API documentation from the correct context path (/myContextPath/v3/api-docs) regardless of the operating system used to access it.
Actual Behavior:
The URL used for Swagger configuration sometimes defaults to /v3/api-docs/swagger-config instead of /myContextPath/v3/api-docs/swagger-config, leading to a failure in loading the configuration.
Additional Notes:
I have tried clearing the cache and disabling CORS, but the issue persists.
This behavior is a regression, as everything was functioning correctly in Spring Boot 2.
The issue seems to be related to how Swagger UI bundles and loads its configuration behind the API gateway.
Suggested Solutions:
It may be helpful to investigate how the context path is being determined and ensure that it consistently resolves correctly across different platforms and API gateway configurations.
Consider providing an option to explicitly set the base path for Swagger UI in the configuration settings.
The text was updated successfully, but these errors were encountered:
I am experiencing an issue with Swagger UI not properly recognizing the context path in a Spring Boot 3 application deployed behind an API gateway. The application works correctly locally and functioned as expected in Spring Boot 2. However, when deployed on a server with the API gateway, Swagger UI intermittently fails to load the configuration, especially when accessed from different operating systems.
I've this error
GET https://myAPIGateway/v3/api-docs/swagger-config 404 (Not Found) on swagger-ui-bundle.js
Environment:
Spring Boot version: 3.x.x2.6.0[insert your version]
Operating Systems tested: macOS, Windows
API Gateway: Gravitee.io
Steps to Reproduce:
Deploy the Spring Boot application behind an API gateway on a server.
Access Swagger UI from a macOS device and confirm it loads correctly with the context path set to /myContextPath.
Access the same Swagger UI from a Windows device, which fails with the error "Failed to load remote configuration."
After this, access from macOS again, and it now also shows the same error.
Expected Behavior:
Swagger UI should consistently recognize and load the API documentation from the correct context path (/myContextPath/v3/api-docs) regardless of the operating system used to access it.
Actual Behavior:
The URL used for Swagger configuration sometimes defaults to /v3/api-docs/swagger-config instead of /myContextPath/v3/api-docs/swagger-config, leading to a failure in loading the configuration.
Additional Notes:
I have tried clearing the cache and disabling CORS, but the issue persists.
This behavior is a regression, as everything was functioning correctly in Spring Boot 2.
The issue seems to be related to how Swagger UI bundles and loads its configuration behind the API gateway.
Suggested Solutions:
It may be helpful to investigate how the context path is being determined and ensure that it consistently resolves correctly across different platforms and API gateway configurations.
Consider providing an option to explicitly set the base path for Swagger UI in the configuration settings.
The text was updated successfully, but these errors were encountered: