Preparing the space for the next example the 4th one

This commit is contained in:
Kanames
2022-06-05 23:07:35 +03:00
parent cf896f7448
commit 0995f3846c
14 changed files with 718 additions and 0 deletions

View File

@@ -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();
}
}