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?

1 Answer 1

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...
  }

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.