From 394dad97cd36cbc57deebcd24ae3e6e00c1297a6 Mon Sep 17 00:00:00 2001 From: San Kim Date: Thu, 3 Oct 2024 17:32:32 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20=EC=98=88=EC=99=B8=20?= =?UTF-8?q?=EC=9D=91=EB=8B=B5=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.yaml | 96 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 71 insertions(+), 25 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 7654c84..87e293f 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -68,6 +68,8 @@ paths: $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' /auth/codes/{authCodeId}/newUser: post: @@ -95,6 +97,8 @@ paths: $ref: '#/components/responses/BadRequest' '404': $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' /users: @@ -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: @@ -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: @@ -166,6 +174,8 @@ paths: application/json: schema: $ref: '#/components/schemas/GetLocationsResponse' + '500': + $ref: '#/components/responses/InternalServerError' /companies: get: @@ -185,6 +195,8 @@ paths: application/json: schema: $ref: '#/components/schemas/SearchCompaniesResponse' + '500': + $ref: '#/components/responses/InternalServerError' /companies/{companyId}: get: @@ -204,6 +216,8 @@ paths: $ref: '#/components/schemas/GetCompanyDetailsResponse' '404': $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/InternalServerError' /jobs: get: @@ -223,6 +237,8 @@ paths: application/json: schema: $ref: '#/components/schemas/SearchJobsResponse' + '500': + $ref: '#/components/responses/InternalServerError' components: securitySchemes: @@ -304,13 +320,27 @@ 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: 리소스를 찾을 수 없음 @@ -318,37 +348,53 @@ components: 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 From 8cf2c38ae3fda4ce1b6d12f97abbccc4363dc404 Mon Sep 17 00:00:00 2001 From: San Kim Date: Thu, 3 Oct 2024 17:38:54 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A9=B9=20validation=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.yaml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 87e293f..8b99362 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -156,7 +156,9 @@ paths: schema: $ref: '#/components/schemas/RefreshTokenResponse' '400': - $ref: '#/components/schemas/ErrorResponse' + $ref: '#/components/responses/InvalidRefreshToken' + '401': + $ref: '#/components/responses/RefreshTokenExpired' '500': $ref: '#/components/responses/InternalServerError' @@ -370,6 +372,33 @@ components: 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: