2

I have followed this documentation to integrate an OpenAPI/swagger document with Spring WebFlux: https://www.baeldung.com/spring-rest-openapi-documentation

I'd like to generate a custom OpenApi document at runtime.

I have attempted to serve a custom @RestController on the appropriate path, but Spring complains that there is already a mapping for the path.

Are there any configuration options for this?

Cheetah
  • 13,785
  • 31
  • 106
  • 190

1 Answers1

3

It would appear I was trying too hard. It was as simple as putting a OpenAPI bean into the context:

@Configuration
public class OpenApiConfig {

  @Bean
  public OpenAPI openAPI() {
    // build open api...
  }

}
Cheetah
  • 13,785
  • 31
  • 106
  • 190