Skip to content

Commit

Permalink
ドキュメント関係のOpenAPI (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikura-hamu authored Jan 3, 2025
1 parent 2d8e65a commit 64cd55a
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions openapi/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ tags:
description: "インスタンスに関するAPI"
- name: "benchmark"
description: "ベンチマークに関するAPI"
- name: "score"
description: "スコアに関するAPI"
- name: "docs"
description: "ドキュメントに関するAPI"

paths:
/oauth2/code:
Expand Down Expand Up @@ -642,6 +646,66 @@ paths:
500:
$ref: "#/components/responses/InternalServerError"

/docs:
get:
tags: ["docs"]
summary: "ドキュメント取得"
description: "Markdown形式のドキュメントを取得します"
operationId: "getDocs"
security:
- UserAuth: []
responses:
200:
description: "ドキュメントの取得に成功"
content:
application/json:
schema:
type: "object"
properties:
body:
$ref: "#/components/schemas/MarkdownDocument"
401:
$ref: "#/components/responses/Unauthorized"
500:
$ref: "#/components/responses/InternalServerError"

patch:
tags: ["docs"]
summary: "ドキュメント更新"
description: "Markdown形式のドキュメントを更新します"
operationId: "patchDocs"
security:
- AdminAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: "object"
properties:
body:
$ref: "#/components/schemas/MarkdownDocument"
required:
- body
responses:
200:
description: "ドキュメントの更新に成功"
content:
application/json:
schema:
type: "object"
properties:
body:
$ref: "#/components/schemas/MarkdownDocument"
400:
$ref: "#/components/responses/BadRequest"
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"

components:
requestBodies:
NewTeam:
Expand Down Expand Up @@ -1041,6 +1105,11 @@ components:
- teamId
- score

MarkdownDocument:
type: "string"
example: "# Title\n\n## Subtitle\n\nContent"
description: "Markdown形式のドキュメント"

ErrorBadRequest:
type: "object"
properties:
Expand Down

0 comments on commit 64cd55a

Please sign in to comment.