From 853709bb44b60822290125c902599d231e5dd667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Mon, 31 Jul 2023 18:16:36 +0900 Subject: [PATCH 1/4] add error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/paths/follow.yaml | 12 +++++++++--- src/openapi/paths/other.yaml | 4 +++- src/openapi/paths/post.yaml | 24 ++++++++++++++++++------ src/openapi/paths/profile.yaml | 4 +++- src/openapi/paths/timeline.yaml | 16 ++++++++++++---- src/openapi/paths/tweet.yaml | 12 +++++++++--- src/openapi/paths/user.yaml | 12 +++++++++--- src/openapi/paths/usertweets.yaml | 20 +++++++++++++++----- 8 files changed, 78 insertions(+), 26 deletions(-) diff --git a/src/openapi/paths/follow.yaml b/src/openapi/paths/follow.yaml index 3ae6491..8861f35 100644 --- a/src/openapi/paths/follow.yaml +++ b/src/openapi/paths/follow.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/FollowResponse" + oneOf: + - $ref: "#/components/schemas/FollowResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user-list" @@ -28,7 +30,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/FollowResponse" + oneOf: + - $ref: "#/components/schemas/FollowResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user-list" @@ -42,7 +46,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/FollowResponse" + oneOf: + - $ref: "#/components/schemas/FollowResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user-list" diff --git a/src/openapi/paths/other.yaml b/src/openapi/paths/other.yaml index 6700968..280b3a8 100644 --- a/src/openapi/paths/other.yaml +++ b/src/openapi/paths/other.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/OtherResponse" + oneOf: + - $ref: "#/components/schemas/OtherResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "other" diff --git a/src/openapi/paths/post.yaml b/src/openapi/paths/post.yaml index 1ea7b6e..86680fd 100644 --- a/src/openapi/paths/post.yaml +++ b/src/openapi/paths/post.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/FavoriteTweetResponseData" + oneOf: + - $ref: "#/components/schemas/FavoriteTweetResponseData" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "post" @@ -28,7 +30,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UnfavoriteTweetResponseData" + oneOf: + - $ref: "#/components/schemas/UnfavoriteTweetResponseData" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "post" @@ -42,7 +46,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateRetweetResponse" + oneOf: + - $ref: "#/components/schemas/CreateRetweetResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "post" @@ -56,7 +62,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/DeleteRetweetResponse" + oneOf: + - $ref: "#/components/schemas/DeleteRetweetResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "post" @@ -70,7 +78,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/CreateTweetResponse" + oneOf: + - $ref: "#/components/schemas/CreateTweetResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "post" @@ -84,7 +94,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/DeleteTweetResponse" + oneOf: + - $ref: "#/components/schemas/DeleteTweetResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "post" diff --git a/src/openapi/paths/profile.yaml b/src/openapi/paths/profile.yaml index b26453c..db3c2d5 100644 --- a/src/openapi/paths/profile.yaml +++ b/src/openapi/paths/profile.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ProfileResponse" + oneOf: + - $ref: "#/components/schemas/ProfileResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" components: schemas: diff --git a/src/openapi/paths/timeline.yaml b/src/openapi/paths/timeline.yaml index a2c4b6a..cb40385 100644 --- a/src/openapi/paths/timeline.yaml +++ b/src/openapi/paths/timeline.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TimelineResponse" + oneOf: + - $ref: "#/components/schemas/TimelineResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -28,7 +30,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TimelineResponse" + oneOf: + - $ref: "#/components/schemas/TimelineResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -42,7 +46,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/ListLatestTweetsTimelineResponse" + oneOf: + - $ref: "#/components/schemas/ListLatestTweetsTimelineResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -56,7 +62,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/SearchTimelineResponse" + oneOf: + - $ref: "#/components/schemas/SearchTimelineResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" diff --git a/src/openapi/paths/tweet.yaml b/src/openapi/paths/tweet.yaml index e6bdef1..87ddd4a 100644 --- a/src/openapi/paths/tweet.yaml +++ b/src/openapi/paths/tweet.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TweetDetailResponse" + oneOf: + - $ref: "#/components/schemas/TweetDetailResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -28,7 +30,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TweetFavoritersResponse" + oneOf: + - $ref: "#/components/schemas/TweetFavoritersResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user-list" @@ -42,7 +46,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TweetRetweetersResponse" + oneOf: + - $ref: "#/components/schemas/TweetRetweetersResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user-list" diff --git a/src/openapi/paths/user.yaml b/src/openapi/paths/user.yaml index 1da25d7..d12620d 100644 --- a/src/openapi/paths/user.yaml +++ b/src/openapi/paths/user.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserResponse" + oneOf: + - $ref: "#/components/schemas/UserResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user" @@ -28,7 +30,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserResponse" + oneOf: + - $ref: "#/components/schemas/UserResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user" @@ -42,7 +46,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UsersResponse" + oneOf: + - $ref: "#/components/schemas/UsersResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "user" diff --git a/src/openapi/paths/usertweets.yaml b/src/openapi/paths/usertweets.yaml index 74a42e0..611d98a 100644 --- a/src/openapi/paths/usertweets.yaml +++ b/src/openapi/paths/usertweets.yaml @@ -14,7 +14,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserTweetsResponse" + oneOf: + - $ref: "#/components/schemas/UserTweetsResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -28,7 +30,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserTweetsResponse" + oneOf: + - $ref: "#/components/schemas/UserTweetsResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -42,7 +46,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserHighlightsTweetsResponse" + oneOf: + - $ref: "#/components/schemas/UserHighlightsTweetsResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -56,7 +62,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserTweetsResponse" + oneOf: + - $ref: "#/components/schemas/UserTweetsResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" @@ -70,7 +78,9 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/UserTweetsResponse" + oneOf: + - $ref: "#/components/schemas/UserTweetsResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "tweet" From 31d7235baf66552f0f97742f2fd4b3093a06d530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Mon, 31 Jul 2023 18:16:41 +0900 Subject: [PATCH 2/4] build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/paths/follow.yaml | 12 +++++++++--- dist/compatible/paths/other.yaml | 4 +++- dist/compatible/paths/post.yaml | 24 ++++++++++++++++++------ dist/compatible/paths/profile.yaml | 4 +++- dist/compatible/paths/timeline.yaml | 16 ++++++++++++---- dist/compatible/paths/tweet.yaml | 12 +++++++++--- dist/compatible/paths/user.yaml | 12 +++++++++--- dist/compatible/paths/usertweets.yaml | 20 +++++++++++++++----- dist/docs/paths/follow.yaml | 12 +++++++++--- dist/docs/paths/other.yaml | 4 +++- dist/docs/paths/post.yaml | 24 ++++++++++++++++++------ dist/docs/paths/profile.yaml | 4 +++- dist/docs/paths/timeline.yaml | 16 ++++++++++++---- dist/docs/paths/tweet.yaml | 12 +++++++++--- dist/docs/paths/user.yaml | 12 +++++++++--- dist/docs/paths/usertweets.yaml | 20 +++++++++++++++----- 16 files changed, 156 insertions(+), 52 deletions(-) diff --git a/dist/compatible/paths/follow.yaml b/dist/compatible/paths/follow.yaml index d0dfc30..a83b4e0 100644 --- a/dist/compatible/paths/follow.yaml +++ b/dist/compatible/paths/follow.yaml @@ -91,7 +91,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FollowResponse' + oneOf: + - $ref: '#/components/schemas/FollowResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -182,7 +184,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FollowResponse' + oneOf: + - $ref: '#/components/schemas/FollowResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -264,7 +268,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FollowResponse' + oneOf: + - $ref: '#/components/schemas/FollowResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/compatible/paths/other.yaml b/dist/compatible/paths/other.yaml index c8e1e3e..0d28120 100644 --- a/dist/compatible/paths/other.yaml +++ b/dist/compatible/paths/other.yaml @@ -90,7 +90,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OtherResponse' + oneOf: + - $ref: '#/components/schemas/OtherResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation tags: - other diff --git a/dist/compatible/paths/post.yaml b/dist/compatible/paths/post.yaml index 777db37..5bedfc7 100644 --- a/dist/compatible/paths/post.yaml +++ b/dist/compatible/paths/post.yaml @@ -181,7 +181,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateRetweetResponse' + oneOf: + - $ref: '#/components/schemas/CreateRetweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -375,7 +377,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateTweetResponse' + oneOf: + - $ref: '#/components/schemas/CreateTweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -449,7 +453,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteRetweetResponse' + oneOf: + - $ref: '#/components/schemas/DeleteRetweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -523,7 +529,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteTweetResponse' + oneOf: + - $ref: '#/components/schemas/DeleteTweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -597,7 +605,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FavoriteTweetResponseData' + oneOf: + - $ref: '#/components/schemas/FavoriteTweetResponseData' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -671,7 +681,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnfavoriteTweetResponseData' + oneOf: + - $ref: '#/components/schemas/UnfavoriteTweetResponseData' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/compatible/paths/profile.yaml b/dist/compatible/paths/profile.yaml index 63e06ed..0489c06 100644 --- a/dist/compatible/paths/profile.yaml +++ b/dist/compatible/paths/profile.yaml @@ -95,7 +95,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProfileResponse' + oneOf: + - $ref: '#/components/schemas/ProfileResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/compatible/paths/timeline.yaml b/dist/compatible/paths/timeline.yaml index 09d648e..3cbc727 100644 --- a/dist/compatible/paths/timeline.yaml +++ b/dist/compatible/paths/timeline.yaml @@ -124,7 +124,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TimelineResponse' + oneOf: + - $ref: '#/components/schemas/TimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -206,7 +208,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TimelineResponse' + oneOf: + - $ref: '#/components/schemas/TimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -286,7 +290,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListLatestTweetsTimelineResponse' + oneOf: + - $ref: '#/components/schemas/ListLatestTweetsTimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -377,7 +383,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SearchTimelineResponse' + oneOf: + - $ref: '#/components/schemas/SearchTimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/compatible/paths/tweet.yaml b/dist/compatible/paths/tweet.yaml index 13cde7f..54e8bd9 100644 --- a/dist/compatible/paths/tweet.yaml +++ b/dist/compatible/paths/tweet.yaml @@ -96,7 +96,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TweetFavoritersResponse' + oneOf: + - $ref: '#/components/schemas/TweetFavoritersResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -180,7 +182,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TweetRetweetersResponse' + oneOf: + - $ref: '#/components/schemas/TweetRetweetersResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -266,7 +270,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TweetDetailResponse' + oneOf: + - $ref: '#/components/schemas/TweetDetailResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/compatible/paths/user.yaml b/dist/compatible/paths/user.yaml index e9b5952..7226106 100644 --- a/dist/compatible/paths/user.yaml +++ b/dist/compatible/paths/user.yaml @@ -68,7 +68,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + oneOf: + - $ref: '#/components/schemas/UserResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -132,7 +134,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + oneOf: + - $ref: '#/components/schemas/UserResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -196,7 +200,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UsersResponse' + oneOf: + - $ref: '#/components/schemas/UsersResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/compatible/paths/usertweets.yaml b/dist/compatible/paths/usertweets.yaml index 452d327..a9e16c6 100644 --- a/dist/compatible/paths/usertweets.yaml +++ b/dist/compatible/paths/usertweets.yaml @@ -120,7 +120,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -213,7 +215,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserHighlightsTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserHighlightsTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -297,7 +301,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -381,7 +387,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -463,7 +471,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/follow.yaml b/dist/docs/paths/follow.yaml index 888b9cb..964a1f3 100644 --- a/dist/docs/paths/follow.yaml +++ b/dist/docs/paths/follow.yaml @@ -183,7 +183,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FollowResponse' + oneOf: + - $ref: '#/components/schemas/FollowResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -376,7 +378,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FollowResponse' + oneOf: + - $ref: '#/components/schemas/FollowResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -550,7 +554,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FollowResponse' + oneOf: + - $ref: '#/components/schemas/FollowResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/other.yaml b/dist/docs/paths/other.yaml index c8e1e3e..0d28120 100644 --- a/dist/docs/paths/other.yaml +++ b/dist/docs/paths/other.yaml @@ -90,7 +90,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OtherResponse' + oneOf: + - $ref: '#/components/schemas/OtherResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation tags: - other diff --git a/dist/docs/paths/post.yaml b/dist/docs/paths/post.yaml index 77ebbdf..73fd91b 100644 --- a/dist/docs/paths/post.yaml +++ b/dist/docs/paths/post.yaml @@ -177,7 +177,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateRetweetResponse' + oneOf: + - $ref: '#/components/schemas/CreateRetweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -369,7 +371,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/CreateTweetResponse' + oneOf: + - $ref: '#/components/schemas/CreateTweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -439,7 +443,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteRetweetResponse' + oneOf: + - $ref: '#/components/schemas/DeleteRetweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -509,7 +515,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeleteTweetResponse' + oneOf: + - $ref: '#/components/schemas/DeleteTweetResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -579,7 +587,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/FavoriteTweetResponseData' + oneOf: + - $ref: '#/components/schemas/FavoriteTweetResponseData' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -649,7 +659,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UnfavoriteTweetResponseData' + oneOf: + - $ref: '#/components/schemas/UnfavoriteTweetResponseData' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/profile.yaml b/dist/docs/paths/profile.yaml index a6a15b1..ddf46f5 100644 --- a/dist/docs/paths/profile.yaml +++ b/dist/docs/paths/profile.yaml @@ -103,7 +103,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ProfileResponse' + oneOf: + - $ref: '#/components/schemas/ProfileResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/timeline.yaml b/dist/docs/paths/timeline.yaml index 6ac368b..5439c57 100644 --- a/dist/docs/paths/timeline.yaml +++ b/dist/docs/paths/timeline.yaml @@ -221,7 +221,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TimelineResponse' + oneOf: + - $ref: '#/components/schemas/TimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -405,7 +407,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TimelineResponse' + oneOf: + - $ref: '#/components/schemas/TimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -574,7 +578,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListLatestTweetsTimelineResponse' + oneOf: + - $ref: '#/components/schemas/ListLatestTweetsTimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -772,7 +778,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SearchTimelineResponse' + oneOf: + - $ref: '#/components/schemas/SearchTimelineResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/tweet.yaml b/dist/docs/paths/tweet.yaml index 8fa8209..fb1d27d 100644 --- a/dist/docs/paths/tweet.yaml +++ b/dist/docs/paths/tweet.yaml @@ -191,7 +191,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TweetFavoritersResponse' + oneOf: + - $ref: '#/components/schemas/TweetFavoritersResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -370,7 +372,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TweetRetweetersResponse' + oneOf: + - $ref: '#/components/schemas/TweetRetweetersResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -569,7 +573,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TweetDetailResponse' + oneOf: + - $ref: '#/components/schemas/TweetDetailResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/user.yaml b/dist/docs/paths/user.yaml index 86ddeb2..cb999a3 100644 --- a/dist/docs/paths/user.yaml +++ b/dist/docs/paths/user.yaml @@ -111,7 +111,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + oneOf: + - $ref: '#/components/schemas/UserResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -210,7 +212,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserResponse' + oneOf: + - $ref: '#/components/schemas/UserResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -301,7 +305,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UsersResponse' + oneOf: + - $ref: '#/components/schemas/UsersResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: diff --git a/dist/docs/paths/usertweets.yaml b/dist/docs/paths/usertweets.yaml index 948efde..8297cea 100644 --- a/dist/docs/paths/usertweets.yaml +++ b/dist/docs/paths/usertweets.yaml @@ -230,7 +230,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -433,7 +435,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserHighlightsTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserHighlightsTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -627,7 +631,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -816,7 +822,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: @@ -1005,7 +1013,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/UserTweetsResponse' + oneOf: + - $ref: '#/components/schemas/UserTweetsResponse' + - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation headers: x-connection-hash: From a865bbaa09498ec56ae2ef25832b9adef4c0686f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Mon, 31 Jul 2023 20:19:29 +0900 Subject: [PATCH 3/4] add CursorType MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/schemas/content.yaml | 16 +++++++++------- dist/docs/schemas/content.yaml | 16 +++++++++------- src/openapi/schemas/content.yaml | 7 +++++-- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/dist/compatible/schemas/content.yaml b/dist/compatible/schemas/content.yaml index dd5f98b..cf53767 100644 --- a/dist/compatible/schemas/content.yaml +++ b/dist/compatible/schemas/content.yaml @@ -25,6 +25,14 @@ components: - $ref: '#/components/schemas/TimelineTimelineItem' - $ref: '#/components/schemas/TimelineTimelineModule' - $ref: '#/components/schemas/TimelineTimelineCursor' + CursorType: + enum: + - Top + - Bottom + - ShowMore + - ShowMoreThreads + - Gap + type: string ItemContentUnion: discriminator: mapping": @@ -92,13 +100,7 @@ components: __typename: $ref: ./typename.yaml#/components/schemas/TypeName cursorType: - enum: - - Top - - Bottom - - ShowMore - - ShowMoreThreads - - Gap - type: string + $ref: '#/components/schemas/CursorType' entryType: $ref: '#/components/schemas/ContentEntryType' itemType: diff --git a/dist/docs/schemas/content.yaml b/dist/docs/schemas/content.yaml index dd5f98b..cf53767 100644 --- a/dist/docs/schemas/content.yaml +++ b/dist/docs/schemas/content.yaml @@ -25,6 +25,14 @@ components: - $ref: '#/components/schemas/TimelineTimelineItem' - $ref: '#/components/schemas/TimelineTimelineModule' - $ref: '#/components/schemas/TimelineTimelineCursor' + CursorType: + enum: + - Top + - Bottom + - ShowMore + - ShowMoreThreads + - Gap + type: string ItemContentUnion: discriminator: mapping": @@ -92,13 +100,7 @@ components: __typename: $ref: ./typename.yaml#/components/schemas/TypeName cursorType: - enum: - - Top - - Bottom - - ShowMore - - ShowMoreThreads - - Gap - type: string + $ref: '#/components/schemas/CursorType' entryType: $ref: '#/components/schemas/ContentEntryType' itemType: diff --git a/src/openapi/schemas/content.yaml b/src/openapi/schemas/content.yaml index 4b33032..1d91d6d 100644 --- a/src/openapi/schemas/content.yaml +++ b/src/openapi/schemas/content.yaml @@ -23,6 +23,10 @@ components: enum: [TimelineTimelineItem, TimelineTimelineCursor, TimelineTimelineModule] + CursorType: + type: string + enum: [Top, Bottom, ShowMore, ShowMoreThreads, Gap] # Gap??? + TimelineTimelineItem: required: - "__typename" @@ -85,8 +89,7 @@ components: itemType: $ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor cursorType: - type: string - enum: [Top, Bottom, ShowMore, ShowMoreThreads, Gap] # Gap??? + $ref: "#/components/schemas/CursorType" value: type: string From e9022df6c3f41423da708371a4211c45c1eeb221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= <34892635+fa0311@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:13:53 +0900 Subject: [PATCH 4/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4735cf0..6e49199 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ Twitter OpenAPI(Swagger) specification +- [Python](https://github.com/fa0311/twitter_openapi_python) - [Dart](https://github.com/fa0311/twitter_openapi_dart) - [TypeScript](https://github.com/fa0311/twitter-openapi-typescript) - [React Documents](https://github.com/fa0311/twitter-openapi-docs)