From f54325771ac70efeb90722f53186146d74e4273d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 6 Aug 2023 19:44:19 +0900 Subject: [PATCH 1/4] add UserUnavailable #28 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/schemas/typename.yaml | 1 + src/openapi/schemas/user.yaml | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/openapi/schemas/typename.yaml b/src/openapi/schemas/typename.yaml index ff3f29e..7be38b1 100644 --- a/src/openapi/schemas/typename.yaml +++ b/src/openapi/schemas/typename.yaml @@ -20,4 +20,5 @@ components: TimelineMessagePrompt, Tweet, User, + UserUnavailable, ] diff --git a/src/openapi/schemas/user.yaml b/src/openapi/schemas/user.yaml index 1349108..2171f07 100644 --- a/src/openapi/schemas/user.yaml +++ b/src/openapi/schemas/user.yaml @@ -17,7 +17,17 @@ components: - "result" properties: result: - $ref: "#/components/schemas/User" + $ref: "#/components/schemas/UserUnion" + + UserUnion: + oneOf: + - $ref: "#/components/schemas/User" + - $ref: "#/components/schemas/UserUnavailable" + discriminator: + propertyName: __typename + mapping": # deprecated + User: "#/components/schemas/User" + UserUnavailable: "#/components/schemas/UserUnavailable" User: required: @@ -211,3 +221,13 @@ components: want_retweets: type: boolean default: false + + UserUnavailable: + required: + - "__typename" + - "reason" + properties: + __typename: + $ref: "./typename.yaml#/components/schemas/TypeName" # UserUnavailable + reason: + type: string From 1560a47a48e7f7b87f8a8eed7582d90a9b72a5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 6 Aug 2023 19:44:44 +0900 Subject: [PATCH 2/4] remove other MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/paths/other.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/src/openapi/paths/other.yaml b/src/openapi/paths/other.yaml index 280b3a8..643005e 100644 --- a/src/openapi/paths/other.yaml +++ b/src/openapi/paths/other.yaml @@ -16,7 +16,6 @@ paths: schema: oneOf: - $ref: "#/components/schemas/OtherResponse" - - $ref: "./../schemas/error.yaml#/components/schemas/Errors" tags: - "other" From 47aeff70c456bda9227f42696db878d1eb57ec86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 6 Aug 2023 19:44:48 +0900 Subject: [PATCH 3/4] build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/schemas/typename.yaml | 1 + dist/compatible/schemas/user.yaml | 20 +++++++++++++++++++- dist/docs/schemas/typename.yaml | 1 + dist/docs/schemas/user.yaml | 20 +++++++++++++++++++- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/dist/compatible/schemas/typename.yaml b/dist/compatible/schemas/typename.yaml index 197eaaa..663cb75 100644 --- a/dist/compatible/schemas/typename.yaml +++ b/dist/compatible/schemas/typename.yaml @@ -13,6 +13,7 @@ components: - TimelineMessagePrompt - Tweet - User + - UserUnavailable type: string info: title: Twitter OpenAPI diff --git a/dist/compatible/schemas/user.yaml b/dist/compatible/schemas/user.yaml index b60ab45..3584f3f 100644 --- a/dist/compatible/schemas/user.yaml +++ b/dist/compatible/schemas/user.yaml @@ -199,9 +199,27 @@ components: UserResults: properties: result: - $ref: '#/components/schemas/User' + $ref: '#/components/schemas/UserUnion' required: - result + UserUnavailable: + properties: + __typename: + $ref: ./typename.yaml#/components/schemas/TypeName + reason: + type: string + required: + - __typename + - reason + UserUnion: + discriminator: + mapping": + User: '#/components/schemas/User' + UserUnavailable: '#/components/schemas/UserUnavailable' + propertyName: __typename + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/UserUnavailable' info: title: Twitter OpenAPI version: 0.0.1 diff --git a/dist/docs/schemas/typename.yaml b/dist/docs/schemas/typename.yaml index 197eaaa..663cb75 100644 --- a/dist/docs/schemas/typename.yaml +++ b/dist/docs/schemas/typename.yaml @@ -13,6 +13,7 @@ components: - TimelineMessagePrompt - Tweet - User + - UserUnavailable type: string info: title: Twitter OpenAPI diff --git a/dist/docs/schemas/user.yaml b/dist/docs/schemas/user.yaml index b60ab45..3584f3f 100644 --- a/dist/docs/schemas/user.yaml +++ b/dist/docs/schemas/user.yaml @@ -199,9 +199,27 @@ components: UserResults: properties: result: - $ref: '#/components/schemas/User' + $ref: '#/components/schemas/UserUnion' required: - result + UserUnavailable: + properties: + __typename: + $ref: ./typename.yaml#/components/schemas/TypeName + reason: + type: string + required: + - __typename + - reason + UserUnion: + discriminator: + mapping": + User: '#/components/schemas/User' + UserUnavailable: '#/components/schemas/UserUnavailable' + propertyName: __typename + oneOf: + - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/UserUnavailable' info: title: Twitter OpenAPI version: 0.0.1 From 0431f498c52a8f4f8b2903a57a65f8f8d3130c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 6 Aug 2023 20:16:54 +0900 Subject: [PATCH 4/4] build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/paths/other.yaml | 1 - dist/docs/paths/other.yaml | 1 - 2 files changed, 2 deletions(-) diff --git a/dist/compatible/paths/other.yaml b/dist/compatible/paths/other.yaml index 0d28120..33e5aa9 100644 --- a/dist/compatible/paths/other.yaml +++ b/dist/compatible/paths/other.yaml @@ -92,7 +92,6 @@ paths: schema: oneOf: - $ref: '#/components/schemas/OtherResponse' - - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation tags: - other diff --git a/dist/docs/paths/other.yaml b/dist/docs/paths/other.yaml index 0d28120..33e5aa9 100644 --- a/dist/docs/paths/other.yaml +++ b/dist/docs/paths/other.yaml @@ -92,7 +92,6 @@ paths: schema: oneOf: - $ref: '#/components/schemas/OtherResponse' - - $ref: ./../schemas/error.yaml#/components/schemas/Errors description: Successful operation tags: - other