diff --git a/todo-app/openapi.yaml b/todo-app/openapi.yaml index 2258929..11fd57a 100644 --- a/todo-app/openapi.yaml +++ b/todo-app/openapi.yaml @@ -19,7 +19,7 @@ paths: API 서버가 잘 작동하는지 확인하는 용도의 API. responses: '200': - description: 멀쩡함. + description: 서버가 정상 작동함 /tasks: get: tags: @@ -52,3 +52,118 @@ paths: type: string description: 할 일 등록 일시 (UTC) example: "2024-10-01 12:34:56" + post: + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + contents: + type: string + description: 내용 + example: "오늘 할 일" + responses: + 200: + description: Task 저장 결과 + content: + application/json: + schema: + type: object + properties: + id: + type: number + description: 저장 된 id 값 + example: 1 + contents: + type: string + description: 내용 + example: "오늘 할 일" + 400: + description: 잘못된 입력 형식 + content: + application/json: + schema: + type: object + properties: + error: + type: string + example: "문자열 타입이 아닙니다." + /tasks/{taskId}: + get: + parameters: + - name: taskId + in: path + required: true + schema: + type: string + responses: + 200: + description: Task 목록 조회 + content: + application/json: + schema: + $ref: '#/components/schemas/Task' + patch: + parameters: + - name: taskId + in: path + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + contents: + type: string + description: 내용 + example: "내일 할 일" + responses: + 200: + description: Task 수정 결과 + content: + application/json: + schema: + type: object + properties: + id: + type: number + description: 저장 된 id 값 + example: 1 + contents: + type: string + description: 내용 + example: "내일 할 일" + delete: + parameters: + - name: taskId + in: path + required: true + schema: + type: string + responses: + 200: + description: Task 삭제 결과 + content: + application/json: + schema: + type: object + properties: + message: + type: string + description: 삭제 성공 + example: "success" +components: + schemas: + Task: + type: object + properties: + id: + type: integer + content: + type: string