Skip to content

Commit

Permalink
Merge pull request #11 from TEAM-DAWM/feat/10
Browse files Browse the repository at this point in the history
[feat] swagger 설정
  • Loading branch information
choyeongju authored Jul 4, 2024
2 parents 860ded9 + 16dcbe4 commit f938393
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ dependencies {

// Validation
implementation 'org.springframework.boot:spring-boot-starter-validation'

//Swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.4'
}

tasks.named('test') {
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/nutshell/server/constant/AuthConstant.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ public class AuthConstant {
public static final String ANONYMOUS_USER = "anonymousUser";
public static final String[] AUTH_WHITELIST = {
"/actuator/health",
"/api/**"
"/api/**",
"/v3/api-docs/**",
"/swagger-ui/**",
"/swagger-ui.html"
};
private AuthConstant() {
}
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/nutshell/server/swagger/SwaggerConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package nutshell.server.swagger;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class SwaggerConfig {

@Bean
public OpenAPI openAPI() {
Info info = new Info()
.title("Nutshell API")
.description("Nutshell Swagger dev API")
.version("v1");

return new OpenAPI()
.components(new Components())
.info(info);
}
}

0 comments on commit f938393

Please sign in to comment.