Configurazione per swagger 2.9.2
This commit is contained in:
@@ -160,7 +160,7 @@
|
||||
<version>8.4.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SWAGGER
|
||||
<!-- SWAGGER -->
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
@@ -171,7 +171,7 @@
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>${swagger.version}</version>
|
||||
</dependency> -->
|
||||
</dependency>
|
||||
|
||||
<!-- REST CLIENT -->
|
||||
<dependency>
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package it.integry.ems.configuration;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration
|
||||
@EnableSwagger2
|
||||
@EnableWebMvc
|
||||
public class SwaggerConfig extends WebMvcConfigurerAdapter {
|
||||
@Bean
|
||||
public Docket api() {
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.any())
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry
|
||||
.addResourceHandler("swagger-ui.html")
|
||||
.addResourceLocations("classpath:/META-INF/resources/");
|
||||
|
||||
registry
|
||||
.addResourceHandler("/webjars/**")
|
||||
.addResourceLocations("classpath:/META-INF/resources/webjars/");
|
||||
}
|
||||
}
|
||||
1
pom.xml
1
pom.xml
@@ -40,6 +40,7 @@
|
||||
<guava.version>22.0</guava.version>
|
||||
<jackson.version>2.17.0</jackson.version>
|
||||
<resteasy.version>3.0.12.Final</resteasy.version>
|
||||
<swagger.version>2.9.2</swagger.version>
|
||||
<ems.war.name>ems</ems.war.name>
|
||||
<brt.tracknumber.listener.enabled>true</brt.tracknumber.listener.enabled>
|
||||
<custom.object.mapper>jacksonResponseObjectMapper</custom.object.mapper>
|
||||
|
||||
Reference in New Issue
Block a user