Skip to content

Commit

Permalink
Docs: SwaggerConfig에 api 버전 그룹 추가 (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
hee9841 authored Nov 6, 2024
1 parent 06c392a commit 1f0a45f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/dnd/runus/presentation/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.commons.lang3.ObjectUtils;
import org.springdoc.core.customizers.OpenApiCustomizer;
import org.springdoc.core.customizers.OperationCustomizer;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.boot.info.BuildProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -43,6 +44,16 @@ public class SwaggerConfig {
private final BuildProperties buildProperties;
private final Environment environment;

@Bean
GroupedOpenApi groupV1() {
return GroupedOpenApi.builder().group("V1").pathsToMatch("/api/v1/**").build();
}

@Bean
GroupedOpenApi groupV2() {
return GroupedOpenApi.builder().group("V2").pathsToMatch("/api/v2/**").build();
}

@Bean
OpenAPI openAPI() {
SecurityScheme securityScheme = new SecurityScheme()
Expand Down

0 comments on commit 1f0a45f

Please sign in to comment.