<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-data-rest</artifactId>
<version>3.0.0-SNAPSHOT</version>
</dependency>
@Profile({"dev-test", "local-test"})
@Configuration
@EnableSwagger2WebMvc
public class SwaggerConfig {
@Bean
public Docket documentation() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(s -> s.matches("/_api/.*"))
.build();
}
}
This error occurs when the profile
is not local-test or dev-test.
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 4 of constructor in springfox.documentation.spring.data.rest.EntityServicesProvider required a bean of type 'com.fasterxml.classmate.TypeResolver' that could not be found.
Action:
Consider defining a bean of type 'com.fasterxml.classmate.TypeResolver' in your configuration.
Hi, i'm using Swagger3.0
with Spring Data Rest.
This is the link I referenced. https://stackoverflow.com/a/46458135/10345277
What I'm doing is trying to turn the Swagger on or off by Profile.
However, unlike the above link, I use SDR and springfox.documentation.spring.data.rest
throws an error.
Is there a solution?