Preparing the space for the next example the 4th one
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package ro.stefan.config;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.MediaType;
|
||||
|
||||
import springfox.documentation.builders.PathSelectors;
|
||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
||||
import springfox.documentation.spi.DocumentationType;
|
||||
import springfox.documentation.spring.web.plugins.Docket;
|
||||
|
||||
@Configuration
|
||||
public class SpringFoxConfig {
|
||||
|
||||
@Bean
|
||||
public Docket getDocketInstance() {
|
||||
final Set<String> produces = new HashSet<String>();
|
||||
produces.add(MediaType.APPLICATION_JSON_VALUE);
|
||||
produces.add(MediaType.APPLICATION_XML_VALUE);
|
||||
produces.add("Stefan's custom mapping value");
|
||||
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.produces(produces)
|
||||
.select()
|
||||
.apis(RequestHandlerSelectors.basePackage("ro.stefan.controller"))
|
||||
.paths(PathSelectors.any())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user