1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00
twitter-openapi/src/openapi/paths/post.yaml
ふぁ 853709bb44
add error handling
Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-07-31 18:16:36 +09:00

258 lines
6.2 KiB
YAML

openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths:
/graphql/{pathQueryId}/FavoriteTweet:
post:
operationId: postFavoriteTweet
description: favorite Tweet
responses:
"200":
description: Successful operation
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/FavoriteTweetResponseData"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
tags:
- "post"
/graphql/{pathQueryId}/UnfavoriteTweet:
post:
operationId: postUnfavoriteTweet
description: unfavorite Tweet
responses:
"200":
description: Successful operation
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UnfavoriteTweetResponseData"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
tags:
- "post"
/graphql/{pathQueryId}/CreateRetweet:
post:
operationId: postCreateRetweet
description: create Retweet
responses:
"200":
description: Successful operation
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/CreateRetweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
tags:
- "post"
/graphql/{pathQueryId}/DeleteRetweet:
post:
operationId: postDeleteRetweet
description: delete Retweet
responses:
"200":
description: Successful operation
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/DeleteRetweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
tags:
- "post"
/graphql/{pathQueryId}/CreateTweet:
post:
operationId: postCreateTweet
description: create Tweet
responses:
"200":
description: Successful operation
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/CreateTweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
tags:
- "post"
/graphql/{pathQueryId}/DeleteTweet:
post:
operationId: postDeleteTweet
description: delete Retweet
responses:
"200":
description: Successful operation
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/DeleteTweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
tags:
- "post"
components:
schemas:
FavoriteTweetResponseData:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/FavoriteTweet"
FavoriteTweet:
required:
- "favorite_tweet"
properties:
favorite_tweet:
type: string
UnfavoriteTweetResponseData:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/UnfavoriteTweet"
UnfavoriteTweet:
required:
- "unfavorite_tweet"
properties:
unfavorite_tweet:
type: string
# ---Retweet---
CreateRetweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/CreateRetweetResponseData"
CreateRetweetResponseData:
required:
- "create_retweet"
properties:
create_retweet:
$ref: "#/components/schemas/CreateRetweetResponseResult"
CreateRetweetResponseResult:
required:
- "retweet_results"
properties:
retweet_results:
$ref: "#/components/schemas/CreateRetweet"
CreateRetweet:
required:
- "result"
properties:
result:
$ref: "#/components/schemas/Retweet"
Retweet:
required:
- "rest_id"
- "legacy"
properties:
rest_id:
type: string
pattern: "^[0-9]+$"
legacy:
type: object
required:
- "full_text"
properties:
full_text:
type: string
DeleteRetweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/DeleteRetweetResponseData"
DeleteRetweetResponseData:
required:
- "unretweet"
properties:
create_retweet:
$ref: "#/components/schemas/CreateRetweetResponseResult"
DeleteRetweetResponseResult:
required:
- "source_tweet_results"
properties:
retweet_results:
$ref: "#/components/schemas/DeleteRetweet"
DeleteRetweet:
required:
- "result"
properties:
result:
type: object
items:
$ref: "#/components/schemas/Retweet"
# ---Tweet---
CreateTweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/CreateTweetResponseData"
CreateTweetResponseData:
required:
- "create_tweet"
properties:
create_tweet:
$ref: "#/components/schemas/CreateTweetResponseResult"
CreateTweetResponseResult:
required:
- "tweet_results"
properties:
tweet_results:
$ref: "#/components/schemas/CreateTweet"
CreateTweet:
required:
- "result"
properties:
result:
$ref: "./../schemas/tweet.yaml#/components/schemas/Tweet"
DeleteTweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/DeleteTweetResponseData"
DeleteTweetResponseData:
required:
- "delete_tweet"
properties:
delete_retweet:
$ref: "#/components/schemas/DeleteTweetResponseResult"
DeleteTweetResponseResult:
required:
- "tweet_results"
properties:
tweet_results:
type: object