I need to exclude endpoints from the documentation which are added to the project through the maven dependency.
My OpenApi configuration:
@Configuration public class OpenApiConfiguration {
@Value("${app.version:unknown}")
private String version;
@Bean
public OpenAPI openAPI() {
return new OpenAPI()
.info(new Info()
.description("Generated OpenAPI 3.0 API")
.version(version));
}
}
My springdoc dependency in pom.xml
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>1.5.8</version>
</dependency>
I have tried to use this in my application.yml, bit it didn't work, endpoints and modeles from maven dependencies were always shown in Open Api docs.
springdoc:
packages-to-exclude:
The only thing that works is adding paths-to-match or paths-to-exclude in the application.yml. But I want exclude the entire lib and avoid listing all the paths.
springdoc:
paths-to-exclude:
paths-to-match:
I use java 8. Is there a way to exclude the library from the Open Api documentation?