Skip to content

[global] 게이트웨이 Swagger UI로 서비스 API 문서 통합 - #17

Open
jyx-07 wants to merge 4 commits into
feat/gateway-response-wrapperfrom
feat/gateway-swagger
Open

jyx-07 wants to merge 4 commits into
feat/gateway-response-wrapperfrom
feat/gateway-swagger

Conversation

@jyx-07

@jyx-07 jyx-07 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

개요

Spring 4개, Nest 2개 서비스의 API 문서를 게이트웨이 /swagger-ui.html 한 곳에서 볼 수 있게 합니다.

본문

  • 게이트웨이에 springdoc webflux UI 추가, 6개 서비스 문서를 springdoc.swagger-ui.urls로 등록
  • Spring 서비스는 문서 경로를 /{prefix}/v3/api-docs로, forward-headers-strategy: framework로 서버 주소를 게이트웨이로 설정
  • Nest 서비스에 @nestjs/swagger 추가, 같은 경로로 문서 제공
  • live, chat은 WebSocket뿐이라 제외

#10 → #12 → #13 → #14 → #15 → #16 → 이 PR 순서로 머지해 주세요.

@jyx-07 jyx-07 added the ✨ Feature 신규 기능 label Nov 3, 2026
@github-actions
github-actions Bot requested a review from cfcromn November 3, 2026 09:08
@jyx-07 jyx-07 changed the title [gateway, auth, shop, minigame, stage, config, user, sp] 게이트웨이 Swagger UI로 서비스 API 문서 통합 [global] 게이트웨이 Swagger UI로 서비스 API 문서 통합 Nov 3, 2026
@jyx-07
jyx-07 force-pushed the feat/gateway-swagger branch from eab575a to 5f7c99b Compare November 3, 2026 14:14
@jyx-07
jyx-07 changed the base branch from develop to feat/gateway-response-wrapper November 3, 2026 14:14
@jyx-07
jyx-07 added this pull request to stack #20 November 3, 2026 14:18
@jyx-07
jyx-07 force-pushed the feat/gateway-swagger branch from 5f7c99b to 2b4cfd7 Compare November 3, 2026 14:19

@cfcromn cfcromn left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문서 조회 테스트는 통과했지만, Try it out에서 JWT를 사용하는 설정이 빠진 것 같습니다.

Comment thread rush-user/src/swagger.ts
const config = new DocumentBuilder()
.setTitle('rush-user')
.setVersion('1.0')
.addBearerAuth()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.addBearerAuth() 외에 인증 요구사항도 연결해 줘야 하지 않을까요? 실제 생성된 문서를 보면 securitySchemes.bearer는 있지만 전역이나 각 API의 security는 없습니다. 이 상태에서는 Authorize에 JWT를 넣어도 요청에 Authorization 헤더가 붙지 않아서 보호된 API가 401을 받습니다. user와 sp에는 전역 또는 API별 요구사항을 추가하고, Spring 서비스 문서에도 Bearer 인증 정의와 적용이 필요해 보입니다.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cfcromn dee026a 에서 반영했습니다. (근거: OpenAPI 3 Security Requirement Object) user와 sp는 addSecurityRequirements('bearer')로 전역 요구사항을 넣었습니다. Spring 4개 서비스에는 OpenApiConfig로 Bearer 인증 정의와 전역 적용을 추가했습니다. e2e 테스트와 단위 테스트로 문서에 security가 들어가는지 확인합니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ Feature 신규 기능

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants