From de45bcf164bad7a8f94abeb48a6c73f27db10149 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Mon, 12 Jun 2023 15:46:29 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20openapi=E3=81=ABpost=E3=81=AE=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=82=92=E6=9B=B8=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/openapi/api.yaml | 91 +++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 src/main/resources/openapi/api.yaml diff --git a/src/main/resources/openapi/api.yaml b/src/main/resources/openapi/api.yaml new file mode 100644 index 00000000..5d79479e --- /dev/null +++ b/src/main/resources/openapi/api.yaml @@ -0,0 +1,91 @@ +openapi: 3.0.3 +info: + title: Hideout API + description: Hideout API + version: 1.0.0 +servers: + - url: 'https://test-hideout.usbharu.dev/api/internal/v1' +paths: + /posts: + get: + summary: 権限に応じて投稿を返す + security: + - { } + - BearerAuth: [ ] + responses: + 200: + description: 成功 + content: + application/json: + schema: + $ref: "#/components/schemas/Post" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 429: + $ref: "#/components/responses/TooManyRequests" + +components: + responses: + Unauthorized: + description: トークンが無効 + Forbidden: + description: 権限がない + NotFound: + description: 存在しないか権限がない + TooManyRequests: + description: レートリミット + + + schemas: + Post: + type: object + properties: + id: + type: integer + format: int64 + readOnly: true + userId: + type: integer + format: int64 + readOnly: true + overview: + type: string + text: + type: string + createdAt: + type: integer + format: int64 + readOnly: true + visibility: + type: string + enum: + - public + - unlisted + - followers + - direct + url: + type: string + format: uri + readOnly: true + repostId: + type: integer + format: int64 + readOnly: true + replyId: + type: integer + format: int64 + readOnly: true + sensitive: + type: boolean + apId: + type: string + format: url + readOnly: true + + + securitySchemes: + BearerAuth: + type: http + scheme: bearer