1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-12 08:00:27 +01:00

[destructive] error handling

This commit is contained in:
ふぁ 2024-11-07 02:02:24 +09:00
parent 28b4dbcaf5
commit db793e66fb
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
16 changed files with 380 additions and 7115 deletions

View file

@ -14,24 +14,22 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/BookmarksResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/BookmarksResponse"
tags:
- "tweet"
components:
schemas:
BookmarksResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/BookmarksResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
BookmarksResponseData:
required:
- "bookmark_timeline_v2"
properties:
bookmark_timeline_v2:
$ref: "#/components/schemas/BookmarksTimeline"

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/FollowResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/FollowResponse"
tags:
- "user-list"
@ -30,9 +28,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/FollowResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/FollowResponse"
tags:
- "user-list"
@ -46,9 +42,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/FollowResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/FollowResponse"
tags:
- "user-list"
@ -60,10 +54,12 @@ components:
properties:
data:
$ref: "#/components/schemas/FollowResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
FollowResponseData:
required:
- "user"
properties:
user:
$ref: "#/components/schemas/FollowResponseUser"

View file

@ -14,13 +14,13 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/OtherResponse"
$ref: "#/components/schemas/OtherObjectAll"
tags:
- "other"
components:
schemas:
OtherResponse:
OtherObjectAll:
type: object
properties:
Session:

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/FavoriteTweetResponseData"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/FavoriteTweetResponse"
tags:
- "post"
@ -30,9 +28,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UnfavoriteTweetResponseData"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UnfavoriteTweetResponse"
tags:
- "post"
@ -46,9 +42,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/CreateRetweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/CreateRetweetResponse"
tags:
- "post"
@ -62,9 +56,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/DeleteRetweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/DeleteRetweetResponse"
tags:
- "post"
@ -78,9 +70,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/CreateTweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/CreateTweetResponse"
tags:
- "post"
@ -94,9 +84,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/DeleteTweetResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/DeleteTweetResponse"
tags:
- "post"
@ -110,9 +98,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/CreateBookmarkResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/CreateBookmarkResponse"
tags:
- "post"
@ -126,38 +112,43 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/DeleteBookmarkResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/DeleteBookmarkResponse"
tags:
- "post"
components:
schemas:
FavoriteTweetResponseData:
# ---Favorite---
FavoriteTweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/FavoriteTweet"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
FavoriteTweet:
required:
- "favorite_tweet"
properties:
favorite_tweet:
type: string
UnfavoriteTweetResponseData:
# ---Unfavorite---
UnfavoriteTweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/UnfavoriteTweet"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
UnfavoriteTweet:
required:
- "unfavorite_tweet"
properties:
unfavorite_tweet:
type: string
@ -170,10 +161,12 @@ components:
properties:
data:
$ref: "#/components/schemas/CreateRetweetResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
CreateRetweetResponseData:
required:
- "create_retweet"
properties:
create_retweet:
$ref: "#/components/schemas/CreateRetweetResponseResult"
@ -208,19 +201,23 @@ components:
full_text:
type: string
# ---DeleteRetweet---
DeleteRetweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/DeleteRetweetResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
DeleteRetweetResponseData:
required:
- "unretweet"
properties:
create_retweet:
$ref: "#/components/schemas/CreateRetweetResponseResult"
$ref: "#/components/schemas/DeleteRetweetResponseResult"
DeleteRetweetResponseResult:
required:
@ -246,10 +243,12 @@ components:
properties:
data:
$ref: "#/components/schemas/CreateTweetResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
CreateTweetResponseData:
required:
- "create_tweet"
properties:
create_tweet:
$ref: "#/components/schemas/CreateTweetResponseResult"
@ -268,16 +267,20 @@ components:
result:
$ref: "./../schemas/tweet.yaml#/components/schemas/Tweet"
# ---DeleteTweet---
DeleteTweetResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/DeleteTweetResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
DeleteTweetResponseData:
required:
- "delete_tweet"
properties:
delete_retweet:
$ref: "#/components/schemas/DeleteTweetResponseResult"
@ -289,30 +292,38 @@ components:
tweet_results:
type: object
# ---Bookmark---
CreateBookmarkResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/CreateBookmarkResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
CreateBookmarkResponseData:
required:
- "tweet_bookmark_put"
properties:
tweet_bookmark_put:
type: string
# ---DeleteBookmark---
DeleteBookmarkResponse:
required:
- "data"
properties:
data:
$ref: "#/components/schemas/DeleteBookmarkResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
DeleteBookmarkResponseData:
required:
- "tweet_bookmark_delete"
properties:
tweet_bookmark_delete:
type: string

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/ProfileResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/ProfileResponse"
components:
schemas:
@ -26,10 +24,12 @@ components:
properties:
data:
$ref: "#/components/schemas/ProfileResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
ProfileResponseData:
required:
- "user_result_by_screen_name"
properties:
user_result_by_screen_name:
$ref: "#/components/schemas/UserResultByScreenName"

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/TimelineResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/TimelineResponse"
tags:
- "tweet"
@ -30,9 +28,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/TimelineResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/TimelineResponse"
tags:
- "tweet"
@ -46,9 +42,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/ListLatestTweetsTimelineResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/ListLatestTweetsTimelineResponse"
tags:
- "tweet"
@ -62,9 +56,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/SearchTimelineResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/SearchTimelineResponse"
tags:
- "tweet"
@ -76,10 +68,12 @@ components:
properties:
data:
$ref: "#/components/schemas/HomeTimelineResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
HomeTimelineResponseData:
required:
- "home"
properties:
home:
$ref: "#/components/schemas/HomeTimelineHome"
@ -97,10 +91,12 @@ components:
properties:
data:
$ref: "#/components/schemas/ListTweetsTimelineData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
ListTweetsTimelineData:
required:
- "list"
properties:
list:
$ref: "#/components/schemas/ListTweetsTimelineList"
@ -123,10 +119,12 @@ components:
properties:
data:
$ref: "#/components/schemas/SearchTimelineData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
SearchTimelineData:
required:
- "search_by_raw_query"
properties:
search_by_raw_query:
$ref: "#/components/schemas/SearchByRawQuery"

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/TweetDetailResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/TweetDetailResponse"
tags:
- "tweet"
@ -30,9 +28,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/TweetResultByRestIdResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/TweetResultByRestIdResponse"
# tags:
# - "tweet"
@ -46,9 +42,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/TweetFavoritersResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/TweetFavoritersResponse"
tags:
- "user-list"
@ -62,9 +56,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/TweetRetweetersResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/TweetRetweetersResponse"
tags:
- "user-list"
@ -76,10 +68,12 @@ components:
properties:
data:
$ref: "#/components/schemas/TweetDetailResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
TweetDetailResponseData:
required:
- "threaded_conversation_with_injections_v2"
properties:
threaded_conversation_with_injections_v2:
$ref: "./../schemas/timeline.yaml#/components/schemas/Timeline"
@ -90,10 +84,12 @@ components:
properties:
data:
$ref: "#/components/schemas/TweetResultByRestIdData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
TweetResultByRestIdData:
required:
- "tweetResult"
properties:
tweetResult:
$ref: "./../schemas/content.yaml#/components/schemas/ItemResult"
@ -104,10 +100,12 @@ components:
properties:
data:
$ref: "#/components/schemas/TweetFavoritersResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
TweetFavoritersResponseData:
required:
- "favoriters_timeline"
properties:
favoriters_timeline:
$ref: "./../schemas/timeline.yaml#/components/schemas/TimelineV2"
@ -118,10 +116,12 @@ components:
properties:
data:
$ref: "#/components/schemas/TweetRetweetersResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
TweetRetweetersResponseData:
required:
- "retweeters_timeline"
properties:
retweeters_timeline:
$ref: "./../schemas/timeline.yaml#/components/schemas/TimelineV2"

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserResponse"
tags:
- "user"
@ -30,9 +28,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserResponse"
tags:
- "user"
@ -46,9 +42,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UsersResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UsersResponse"
tags:
- "users"
@ -60,6 +54,10 @@ components:
properties:
data:
$ref: "#/components/schemas/UserResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
UserResponseData:
properties:
@ -72,10 +70,12 @@ components:
properties:
data:
$ref: "#/components/schemas/UsersResponseData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
UsersResponseData:
required:
- "users"
properties:
users:
type: array

View file

@ -14,9 +14,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserTweetsResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "tweet"
@ -30,9 +28,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserTweetsResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "tweet"
@ -46,9 +42,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserHighlightsTweetsResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserHighlightsTweetsResponse"
tags:
- "tweet"
@ -62,9 +56,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserTweetsResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "tweet"
@ -78,9 +70,7 @@ paths:
content:
application/json:
schema:
oneOf:
- $ref: "#/components/schemas/UserTweetsResponse"
- $ref: "./../schemas/error.yaml#/components/schemas/Errors"
$ref: "#/components/schemas/UserTweetsResponse"
tags:
- "tweet"
@ -92,10 +82,12 @@ components:
properties:
data:
$ref: "#/components/schemas/UserTweetsData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
UserTweetsData:
required:
- "user"
properties:
user:
$ref: "#/components/schemas/UserTweetsUser"
@ -123,10 +115,12 @@ components:
properties:
data:
$ref: "#/components/schemas/UserHighlightsTweetsData"
errors:
type: array
items:
$ref: "./../response/error.yaml#/components/schemas/Error"
UserHighlightsTweetsData:
required:
- "user"
properties:
user:
$ref: "#/components/schemas/UserHighlightsTweetsUser"

View file

@ -6,25 +6,6 @@ info:
paths: {}
components:
schemas:
Errors:
type: object
required:
- errors
properties:
errors:
type: array
items:
$ref: "#/components/schemas/Error"
data:
$ref: "#/components/schemas/ErrorsData"
ErrorsData:
type: object
properties:
user:
type: string # always null
pattern: "dummy"
Error:
type: object
required: