Skip to content

Disabling of 'Try it out' button does not work for external swagger urls #2728

Closed
@eekyrus

Description

@eekyrus

Describe the bug

In Spring Gateway application we import OpenAPI specs from multiple downstream services. Our configuration is like this:
We add multiple groups to SwaggerUiConfigParameters and then have Spring Gateway routes defined for external OpenAPI spec locations. Setting springdoc.swagger-ui.supportedSubmitMethods to empty array in Gateway application does not disable 'Try it out' button. However springdoc.swagger-ui.try-it-out-enabled seems to work fine for enabling Try out by default.

To Reproduce

  1. Create Spring Gateway application with springdoc-openapi-starter-webflux-ui:2.6.0 dependency.
  2. In Spring's configuration class have for Springdoc
@PostConstruct
public void apis() {
    swaggerUiConfigParameters.addGroup("firstservice", "First Service");
}

and for Gateway

@Bean
public RouteLocator routes(RouteLocatorBuilder builder) {
    return builder
        .routes()
        .route("First service Open Api", ps -> ps
            .path("/v3/api-docs/firstservice")
            .filters(gatewayFilterSpec -> gatewayFilterSpec.rewritePath("^.*$", "/v3/api-docs")
            )
            .uri("http://localhost:8082")
        )
        .build();
}
  1. Have one other applications that have Open API specs available at /v3/api-docs running at host localhost:8082
  • What version of spring-boot you are using?
    3.3.4
  • What modules and versions of springdoc-openapi are you using?
    springdoc-openapi-starter-webflux-ui:2.6.0
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
  • Provide with a sample code (HelloController) or Test that reproduces the problem

Expected behavior

'Try it out' button disabled in Swagger-UI

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsincompleteincomplete description: Make sure you Provide a Minimal, Reproducible Example - with HelloController

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions