Closed eekyrus closed 5 days ago
@eekyrus,
Again, Remember, contributions to this repository should follow its contributing guidelines, security policy, and code of conduct.
For how to use the gateway with services, see the following demos samples:
The demo doesn't use GroupedOpenApi.
@eekyrus,
See the answer here https://github.com/springdoc/springdoc-openapi/issues/2741 why GroupedOpenApi are not used anymore.
As I understand, GroupedOpenApi is still used for internal OpenApi spec generation, while Swagger urls property on SwaggerUiConfigProperties is used for external OpenApi spec generation. The issue here is that they cannot be combined. Is this intended behavior?
@eekyrus,
You maybe do did not read the answer...
We limited the use GroupedOpenApi
. so scan for beans within the same application context, to allow dynamic scan.
If you have external URL, that you need to aggregate them based on SwaggerUrl
.
Which means they can be combined for different purposes.
Describe the bug
I want to combine internal application's OpenAPI spec with external specs into one single Swagger UI. According to already solved issues: https://github.com/springdoc/springdoc-openapi/issues/309 https://github.com/springdoc/springdoc-openapi/issues/584 it should be possible:
To Reproduce Steps to reproduce the behavior:
Start application which contains OpenAPI spec: https://github.com/eekyrus/Microservice Start Spring Gateway application which contains both external Swagger url configuration and GroupedOpenApi configuration: https://github.com/eekyrus/GroupedOpenApiBug
Try accessing Swagger via localhost:8080/swagger-ui.html.
Expected behavior
Both groups under Definitions dropdown display Swagger UI. 'Microservice' definition should display external Microservice application OpenAPI spec, while 'internalservice' definition should display internal application's OpenAPI spec (empty in demo application).
Additional context In demo application, removing GroupedOpenApi bean definition and uncommenting PostConstruct code snippet which only defines external swagger urls makes external OpenAPI specs work. It seems that the Spring Gateway application does not receive request to its routing mechanism when GroupedOpenApi configuration is used and does not forward request to Microservice application.