I have a SpringBoot application for which I have created a Swagger implementation. However, the new OpenAPI 3.0 specification brings a default section containing plenty of unnecessary endpoints / metadata. I could not find a solution yet to removing this default section containing all these endpoints that have been unnecessary added by default to my Swagger implementation of my REST API framework. Has anyone been confronted with such issue ?
Where are these endpoints coming from ? How can they be removed ?
Default Section in Swagger printscreen
@RequestMapping("/addresses")
@RestController
@PermitAll
@Tag(name="Addresses",description="Addresses API")
public class AddressRest {
@Autowired
private AddressesService addressService;
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<AddressDTO> findAll() {
return this.addressService.findAll();
}
application.yml file looks as below. I tried to use the paths-to-exclude property but it does not seem to work. What am I missing ?
springdoc:
swagger-ui:
path: /swagger-ui.html
query-config-enabled: true
api-docs:
path: /api/openapi.json
enabled: false
paths-to-exclude:
- /api/healthcheck
build.gradle file containing the following dependecies:
implementation 'org.springdoc:springdoc-openapi-ui:1.6.12'
implementation 'io.swagger.core.v3:swagger-jaxrs2:2.2.6'