Skip to content

Commit

Permalink
♻️ 예외 응답 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW committed Oct 3, 2024
1 parent 88f3df7 commit 394dad9
Showing 1 changed file with 71 additions and 25 deletions.
96 changes: 71 additions & 25 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,10 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/RefreshTokenResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'400':
$ref: '#/components/schemas/ErrorResponse'
'500':
$ref: '#/components/responses/InternalServerError'

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

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

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

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

components:
securitySchemes:
Expand Down Expand Up @@ -304,51 +320,81 @@ 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: "서버 오류가 발생했습니다."


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

0 comments on commit 394dad9

Please sign in to comment.