mirror of https://github.com/usbharu/Hideout.git
feat: openapiにpostの定義を書いた
This commit is contained in:
parent
de45bcf164
commit
5100814840
|
@ -8,10 +8,57 @@ servers:
|
||||||
paths:
|
paths:
|
||||||
/posts:
|
/posts:
|
||||||
get:
|
get:
|
||||||
summary: 権限に応じて投稿を返す
|
summary: 権限に応じて投稿一覧を返す
|
||||||
security:
|
security:
|
||||||
- { }
|
- { }
|
||||||
- BearerAuth: [ ]
|
- BearerAuth: [ ]
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: 成功
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/Post"
|
||||||
|
401:
|
||||||
|
$ref: "#/components/responses/Unauthorized"
|
||||||
|
403:
|
||||||
|
$ref: "#/components/responses/Forbidden"
|
||||||
|
429:
|
||||||
|
$ref: "#/components/responses/TooManyRequests"
|
||||||
|
post:
|
||||||
|
summary: 投稿する
|
||||||
|
security:
|
||||||
|
- BearerAuth: [ ]
|
||||||
|
requestBody:
|
||||||
|
description: 投稿する内容
|
||||||
|
required: true
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Post"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: 成功
|
||||||
|
headers:
|
||||||
|
Location:
|
||||||
|
description: 作成した投稿のURL
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
401:
|
||||||
|
$ref: "#/components/responses/Unauthorized"
|
||||||
|
429:
|
||||||
|
$ref: "#/components/responses/TooManyRequests"
|
||||||
|
/posts/{postId}:
|
||||||
|
get:
|
||||||
|
summary: 権限に応じてIDの投稿を取得
|
||||||
|
security:
|
||||||
|
- { }
|
||||||
|
- BearerAuth: [ ]
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/postId"
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: 成功
|
description: 成功
|
||||||
|
@ -23,6 +70,57 @@ paths:
|
||||||
$ref: "#/components/responses/Unauthorized"
|
$ref: "#/components/responses/Unauthorized"
|
||||||
403:
|
403:
|
||||||
$ref: "#/components/responses/Forbidden"
|
$ref: "#/components/responses/Forbidden"
|
||||||
|
404:
|
||||||
|
$ref: "#/components/responses/NotFound"
|
||||||
|
429:
|
||||||
|
$ref: "#/components/responses/TooManyRequests"
|
||||||
|
/users/{userName}/posts:
|
||||||
|
get:
|
||||||
|
summary: 権限に応じてユーザーの投稿一覧を返す
|
||||||
|
security:
|
||||||
|
- { }
|
||||||
|
- BearerAuth: [ ]
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/userName"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: 成功
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/Post"
|
||||||
|
401:
|
||||||
|
$ref: "#/components/responses/Unauthorized"
|
||||||
|
403:
|
||||||
|
$ref: "#/components/responses/Forbidden"
|
||||||
|
429:
|
||||||
|
$ref: "#/components/responses/TooManyRequests"
|
||||||
|
|
||||||
|
/users/{userName}/posts/{postId}:
|
||||||
|
get:
|
||||||
|
summary: 権限に応じてIDの投稿を取得
|
||||||
|
description: userNameが間違っていても取得できます。
|
||||||
|
security:
|
||||||
|
- { }
|
||||||
|
- BearerAuth: [ ]
|
||||||
|
parameters:
|
||||||
|
- $ref: "#/components/parameters/userName"
|
||||||
|
- $ref: "#/components/parameters/postId"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: 成功
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: "#/components/schemas/Post"
|
||||||
|
401:
|
||||||
|
$ref: "#/components/responses/Unauthorized"
|
||||||
|
403:
|
||||||
|
$ref: "#/components/responses/Forbidden"
|
||||||
|
404:
|
||||||
|
$ref: "#/components/responses/NotFound"
|
||||||
429:
|
429:
|
||||||
$ref: "#/components/responses/TooManyRequests"
|
$ref: "#/components/responses/TooManyRequests"
|
||||||
|
|
||||||
|
@ -37,6 +135,22 @@ components:
|
||||||
TooManyRequests:
|
TooManyRequests:
|
||||||
description: レートリミット
|
description: レートリミット
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
postId:
|
||||||
|
name: postId
|
||||||
|
in: path
|
||||||
|
description: 投稿ID
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
userName:
|
||||||
|
name: userName
|
||||||
|
in: path
|
||||||
|
description: ユーザーIDまたはAcctなど @name@domain name@domain name
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
|
||||||
schemas:
|
schemas:
|
||||||
Post:
|
Post:
|
||||||
|
|
Loading…
Reference in New Issue