mirror of
https://github.com/cna-bootcamp/phonebill.git
synced 2026-06-12 19:49:10 +00:00
API Gateway Swagger 통합 문제 분석 완료
주요 문제점 식별: - Gateway 라우팅 경로 불일치 (product-service: /products/**, bill-service: /api/v1/bills/**) - OpenAPI 서버 정보와 실제 Gateway 경로 매핑 누락 - Swagger UI에서 "Try it out" 기능 미작동 다음 단계: 라우팅 경로 통일화 및 OpenAPI 서버 정보 수정 예정 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.servers.Server;
|
||||
import org.springdoc.core.models.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -39,9 +40,18 @@ public class SwaggerConfig {
|
||||
.addServerVariable("port", new io.swagger.v3.oas.models.servers.ServerVariable()
|
||||
._default("8081")
|
||||
.description("Server port"))))
|
||||
.addSecurityItem(new SecurityRequirement().addList("Bearer Authentication"))
|
||||
.addSecurityItem(new SecurityRequirement().addList("bearerAuth"))
|
||||
.components(new Components()
|
||||
.addSecuritySchemes("Bearer Authentication", createAPIKeyScheme()));
|
||||
.addSecuritySchemes("bearerAuth", createAPIKeyScheme()));
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi userApi() {
|
||||
return GroupedOpenApi.builder()
|
||||
.group("user")
|
||||
.displayName("User Service")
|
||||
.pathsToMatch("/api/v1/auth/**", "/api/v1/users/**")
|
||||
.build();
|
||||
}
|
||||
|
||||
private Info apiInfo() {
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
server:
|
||||
port: ${SERVER_PORT:8081}
|
||||
# HTTP 헤더 크기 제한 설정
|
||||
max-http-header-size: 64KB
|
||||
max-http-request-header-size: 64KB
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: user-service
|
||||
@@ -54,10 +60,6 @@ spring:
|
||||
redis:
|
||||
time-to-live: 1800000 # 30분
|
||||
cache-null-values: false
|
||||
|
||||
# 서버 설정
|
||||
server:
|
||||
port: ${SERVER_PORT:8081}
|
||||
|
||||
# CORS
|
||||
cors:
|
||||
|
||||
Reference in New Issue
Block a user