How to disable /application.wadl in OpenAPI spec with Jersey

Viewed 172

Setup

I use a Spring Boot app from the Initializr with Jersey dependency included and add io.swagger.core.v3:swagger-jaxrs2:2.1.13 as an additional dependency. Then I create the following ResourceConfig (registering other resource classes omitted for brevity):

@Component
public class JerseyConfig extends ResourceConfig {
    public JerseyConfig() {
        this.registerClasses(
                OpenApiResource.class
        );
    }
}

When I start the application and have a look at the generated API spec at http://localhost:8080/openapi.json, I find two paths:

  • GET /application.wadl/{path} and
  • GET /application.wadl

In Swagger UI, it looks like this:

enter image description here

When I send a request to the WADL endpoint, I get a 404 response in this setup. I already tried to disable the WADL feature with this line, but the spec still contains the two paths:

this.property(ServerProperties.WADL_FEATURE_DISABLE, true);

Question

How do I disable or hide these two paths in the OpenAPI spec properly?

1 Answers

May be you can try packages-to-scan property

springdoc:
   packages-to-scan:
    - com.myapp.appName.controller
Related