Created
July 19, 2021 12:56
-
-
Save YusukeIwaki/ce8a7250fb7e5279267c495324de19f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.1 | |
info: | |
title: エンジニア・プログラマにしか使えないSNS | |
description: | | |
通常のSNSで胡散臭い人が多いと感じてしまいました | |
プログラミングスクールが流行り、エンジニアになって億稼いでます!みたいな・・・ | |
そこで、本当のエンジニア・プログラマしか使えないSNSを作ってみました! | |
つまり、WebApi提供のみのSNSです | |
一般ピープルが使うようなフロントエンドなんてありません!! | |
Postmanなり、なんなりを使って叩いてください" | |
version: 1.0.0 | |
externalDocs: | |
description: "元記事: エンジニア・プログラマにしか使えないSNSを作ってみた話" | |
url: https://qiita.com/HawkClaws/items/599d7666f55e79ef7f56 | |
servers: | |
- url: https://versatileapi.herokuapp.com/api | |
paths: | |
/user/create_user: | |
post: | |
summary: ユーザ登録 | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/CreateUserRequest' | |
responses: | |
201: | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: object | |
properties: | |
id: | |
type: string | |
description: ユーザID | |
put: | |
summary: ユーザ情報更新(なのにユーザIDを指定しない?!全項目必須?!) | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/CreateUserRequest' | |
responses: | |
200: | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: object | |
properties: | |
id: | |
type: string | |
description: ユーザID | |
/user/{id}: | |
get: | |
summary: ユーザ取得(単一) | |
parameters: | |
- name: id | |
in: path | |
description: ユーザID | |
required: true | |
schema: | |
type: string | |
responses: | |
200: | |
description: OK | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/User' | |
/user/all: | |
get: | |
summary: ユーザ一覧取得 | |
responses: | |
200: | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: array | |
items: | |
$ref: '#/components/schemas/User' | |
/text: | |
post: | |
summary: つぶやく | |
requestBody: | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/TextRequest' | |
responses: | |
201: | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: object | |
properties: | |
id: | |
type: string | |
description: TextID | |
/text/{id}: | |
get: | |
summary: つぶやき取得(単一) | |
parameters: | |
- name: id | |
in: path | |
description: TextID | |
required: true | |
schema: | |
type: string | |
responses: | |
200: | |
description: OK | |
content: | |
application/json: | |
schema: | |
$ref: '#/components/schemas/Text' | |
/text/all: | |
get: | |
summary: つぶやき一覧取得 | |
responses: | |
200: | |
description: OK | |
content: | |
application/json: | |
schema: | |
type: array | |
items: | |
$ref: '#/components/schemas/Text' | |
components: | |
schemas: | |
CreateUserRequest: | |
type: object | |
properties: | |
name: | |
type: string | |
description: ユーザ名 | |
maxLength: 30 | |
description: | |
type: string | |
description: 自己紹介文 | |
maxLength: 300 | |
required: | |
- name | |
- description | |
User: | |
type: object | |
properties: | |
id: | |
type: string | |
description: ユーザID | |
name: | |
type: string | |
description: ユーザ名 | |
description: | |
type: string | |
description: 自己紹介文 | |
_user_id: | |
type: string | |
description: ユーザID | |
_created_at: | |
type: string | |
description: 登録日時 | |
_updated_at: | |
type: string | |
description: 最終更新日時 | |
TextRequest: | |
type: object | |
properties: | |
text: | |
type: string | |
description: 投稿する文章 | |
minLength: 1 | |
maxLength: 280 | |
in_reply_to_user_id: | |
type: string | |
description: 返信対象のUserId | |
minLength: 40 | |
maxLength: 40 | |
in_reply_to_text_id: | |
type: string | |
description: 返信対象のTextId | |
minLength: 36 | |
maxLength: 36 | |
required: | |
- text | |
- description | |
Text: | |
type: object | |
properties: | |
id: | |
type: string | |
description: TextID | |
text: | |
type: string | |
description: つぶやき | |
in_reply_to_user_id: | |
type: string | |
description: 返信対象のUserId | |
in_reply_to_text_id: | |
type: string | |
description: 返信対象のTextId | |
_user_id: | |
type: string | |
description: ユーザID | |
_created_at: | |
type: string | |
description: 投稿日時 | |
_updated_at: | |
type: string | |
description: 最終更新日時 | |
securitySchemes: | |
authorization_helloworld: | |
type: apiKey | |
in: header | |
name: Authorization |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://bit.ly/39hZjMB
or
https://editor.swagger.io/?url=https://gist.githubusercontent.com/YusukeIwaki/ce8a7250fb7e5279267c495324de19f7/raw/292eb24fb381c9af49fc42c901794ec2d98d134a/openapi.yml