Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ 예외 응답 개선 #16

Merged
merged 2 commits into from
Oct 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
123 changes: 99 additions & 24 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ paths:
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'

/auth/codes/{authCodeId}/newUser:
post:
Expand Down Expand Up @@ -95,6 +97,8 @@ paths:
$ref: '#/components/responses/BadRequest'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'


/users:
Expand Down Expand Up @@ -127,7 +131,9 @@ paths:
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
$ref: '#/components/responses/RegisterTokenExpired'
'500':
$ref: '#/components/responses/InternalServerError'

/auth/token/refresh:
post:
Expand All @@ -149,8 +155,12 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RefreshTokenResponse'
'400':
$ref: '#/components/responses/InvalidRefreshToken'
'401':
$ref: '#/components/responses/Unauthorized'
$ref: '#/components/responses/RefreshTokenExpired'
'500':
$ref: '#/components/responses/InternalServerError'

/locations:
get:
Expand All @@ -166,6 +176,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/GetLocationsResponse'
'500':
$ref: '#/components/responses/InternalServerError'

/companies:
get:
Expand All @@ -185,6 +197,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SearchCompaniesResponse'
'500':
$ref: '#/components/responses/InternalServerError'

/companies/{companyId}:
get:
Expand All @@ -204,6 +218,8 @@ paths:
$ref: '#/components/schemas/GetCompanyDetailsResponse'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalServerError'

/jobs:
get:
Expand All @@ -223,6 +239,8 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/SearchJobsResponse'
'500':
$ref: '#/components/responses/InternalServerError'

components:
securitySchemes:
Expand Down Expand Up @@ -304,51 +322,108 @@ components:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'

Unauthorized:
description: 인증 실패
examples:
invalidRequest:
value:
time: "2024-05-01T00:00:00Z"
type: "COMMON"
code: "1001"
message: "잘못된 요청입니다."

RegisterTokenExpired:
description: 회원 가입 토큰 만료
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tokenExpired:
value:
time: "2024-05-01T00:00:00Z"
type: "AUTH"
code: "1003"
message: "회원 가입 토큰이 만료되었습니다."

NotFound:
description: 리소스를 찾을 수 없음
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
notFound:
value:
time: "2024-05-01T00:00:00Z"
type: "COMMON"
code: "1002"
message: "리소스를 찾을 수 없습니다."

InternalServerError:
description: 서버 오류
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
serverError:
value:
time: "2024-05-01T00:00:00Z"
type: "COMMON"
code: "1003"
message: "서버 오류가 발생했습니다."

RefreshTokenExpired:
description: 리프레시 토큰 만료
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
tokenExpired:
value:
time: "2024-05-01T00:00:00Z"
type: "AUTH"
code: "1008"
message: "리프레시 토큰이 만료되었습니다."

InvalidRefreshToken:
description: 유효하지 않은 리프레시 토큰
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalidToken:
value:
time: "2024-05-01T00:00:00Z"
type: "AUTH"
code: "1009"
message: "유효하지 않은 리프레시 토큰입니다."

schemas:
ErrorResponse:
type: object
properties:
timestamp:
type: integer
format: int64
description: 에러 발생 시각 (Unix timestamp)
status:
type: integer
description: HTTP 상태 코드
error:
time:
type: string
format: date-time
description: 에러 발생 시각 (ISO 8601)
example: "2024-05-01T00:00:00Z"
type:
type: string
description: 에러 유형
example: USER
exception:
example: COMMON
code:
type: string
description: 예외 클래스 이름
description: 에러 코드
example: "1001"
message:
type: string
description: 상세 에러 메시지
path:
type: string
description: 에러가 발생한 요청 경로
required:
- timestamp
- status
- error
- message
- path
- time
- type
- code

SendAuthCodeRequest:
type: object
Expand Down