Skip to content

Commit

Permalink
Merge pull request #75 from arey/feature/swagger-openapi3
Browse files Browse the repository at this point in the history
Configure Springfox to generate the OpenAPI 3 specification
  • Loading branch information
arey authored Dec 30, 2021
2 parents a378a8d + 5e542f2 commit 1588fd8
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@
* limitations under the License.
*/

package org.springframework.samples.petclinic.util;
package org.springframework.samples.petclinic.config;


import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import org.springframework.util.ReflectionUtils;
import org.springframework.web.servlet.mvc.method.RequestMappingInfoHandlerMapping;
import springfox.documentation.builders.PathSelectors;
Expand All @@ -33,28 +31,22 @@
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.spring.web.plugins.WebFluxRequestHandlerProvider;
import springfox.documentation.spring.web.plugins.WebMvcRequestHandlerProvider;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import java.lang.reflect.Field;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

/**
* Java config for Springfox swagger documentation plugin
*
* @author Vitaliy Fedoriv
*
*/

@Configuration
@EnableSwagger2
@ComponentScan(basePackages="org.springframework.samples.petclinic.rest")
public class ApplicationSwaggerConfig {
public class SwaggerConfig {

@Bean
public Docket customDocket(){
return new Docket(DocumentationType.SWAGGER_2)
return new Docket(DocumentationType.OAS_30)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
Expand Down

0 comments on commit 1588fd8

Please sign in to comment.