feat(api-doc): add OpenAPI 3.1.0 + AsyncAPI 3.0.0 + Redoc UI with CI validation#16
Merged
Conversation
- Add .spectral.yaml with oas3-schema error rule and operation-description/tags warnings - Add .github/workflows/api-doc.yml with OpenAPI Spectral lint and AsyncAPI validate jobs - Fix YAML parse error in openapi.yaml (unquoted colon in example string on line 350)
ppzxc
commented
Mar 20, 2026
ppzxc
left a comment
Owner
Author
There was a problem hiding this comment.
전체적으로 스펙에 충실하고 불필요한 코드 없이 목적에 맞게 구현되어 있다.
긍정적인 점:
embed.go— 핸들러가 각 10줄 이하로 단순하고 명확.//nolint:errcheck주석은ResponseWriter.Write()에러 무시의 의도를 명확히 표현router.go—/docs라우트가 auth 미들웨어 바깥에 등록 (공개 엔드포인트로 올바름)embed_test.go— black-box 테스트 패키지(apidocs_test), Content-Type + body 내용까지 검증openapi.yaml—security: []로/healthzoverride,x-status: planned으로 미구현 엔드포인트 표시asyncapi.yaml—action: receive(서버 수신 방향 정확),additionalProperties: true(다형적 페이로드 허용)- GitHub Actions —
permissions: contents: read최소 권한, 버전 핀 고정
마이너 관찰 (비차단):
embed_test.go:26—// placeholder는 version "0.0.0"주석은 TDD 개발 흔적. 현재 코드와 맞지 않아 혼란을 줄 수 있으나 기능에 영향 없음- AsyncAPI CI가 아직 pending — 결과 확인 후 머지 권장
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/apidocs/패키지: OpenAPI 3.1.0 + AsyncAPI 3.0.0 스펙 파일 + Redoc v2 standalone JS 바이너리 embed/docs,/docs/openapi,/docs/asyncapiHTTP 엔드포인트 추가 (chi 라우터 통합)Motivation
단일 바이너리에 문서 UI를 포함해 외부 CDN 의존 없이 API 문서를 서빙한다.
구현된 엔드포인트와 계획 중인 엔드포인트(
x-status: planned)를 모두 문서화했다.Changes
internal/apidocs/embed.go—//go:embed선언 + 3개 HTTP 핸들러internal/apidocs/openapi.yaml— OpenAPI 3.1.0 (9개 엔드포인트, 3개 구현 + 6개 planned)internal/apidocs/asyncapi.yaml— AsyncAPI 3.0.0 (WebSocket 인바운드 채널)internal/apidocs/redoc.standalone.js— Redoc v2.1.5 standalone bundle (~887KB)internal/apidocs/embed_test.go— 핸들러 유닛 테스트internal/adapter/input/http/router.go—/docs라우트 그룹 추가internal/adapter/input/http/handler_test.go— docs 엔드포인트 통합 테스트.spectral.yaml— OAS 3.1 ruleset (oas3-schema: error).github/workflows/api-doc.yml— Spectral @6.15.0 + AsyncAPI CLI @3.6.0 검증 워크플로Test plan
go test -race ./internal/apidocs/... ./internal/adapter/input/http/...통과 확인go build -o webhook-relay ./cmd/server/빌드 성공 확인curl http://localhost:8080/docs→ Redoc HTML 응답 확인curl http://localhost:8080/docs/openapi→ OpenAPI YAML 응답 확인api-doc.yml워크플로 통과 확인