From 5a9695407e1292a5b3a54e443cdf924ab508ec4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 14 Nov 2024 12:19:54 +0900 Subject: [PATCH] feat follow up #78 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/schemas/tweet.yaml | 26 +++++++++++++++++++++++++- test/python/test_serialize.py | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/openapi/schemas/tweet.yaml b/src/openapi/schemas/tweet.yaml index 9d8d3f6..f7fb3c7 100644 --- a/src/openapi/schemas/tweet.yaml +++ b/src/openapi/schemas/tweet.yaml @@ -543,7 +543,7 @@ components: delete_action_result: $ref: "#/components/schemas/CommunityDeleteActionResult" join_action_result: - $ref: "#/components/schemas/CommunityJoinActionResult" + $ref: "#/components/schemas/CommunityJoinActionUnion" leave_action_result: $ref: "#/components/schemas/CommunityLeaveActionResult" pin_action_result: @@ -562,6 +562,16 @@ components: type: string enum: [Unavailable] + CommunityJoinActionUnion: + oneOf: + - $ref: "#/components/schemas/CommunityJoinActionResult" + - $ref: "#/components/schemas/CommunityJoinActionUnavailable" + discriminator: + propertyName: __typename + mapping: # deprecated + CommunityJoinAction: "#/components/schemas/CommunityJoinActionResult" + CommunityJoinActionUnavailable: "#/components/schemas/CommunityJoinActionUnavailable" + CommunityJoinActionResult: required: - "__typename" @@ -569,6 +579,20 @@ components: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # CommunityJoinAction + CommunityJoinActionUnavailable: + required: + - "__typename" + - "reason" + - "message" + properties: + __typename: + $ref: "./typename.yaml#/components/schemas/TypeName" # CommunityJoinActionUnavailable + reason: + type: string + enum: [ViewerRequestRequired] + message: + type: string + CommunityLeaveActionResult: required: - "__typename" diff --git a/test/python/test_serialize.py b/test/python/test_serialize.py index 5897f84..8f15ec3 100644 --- a/test/python/test_serialize.py +++ b/test/python/test_serialize.py @@ -376,6 +376,7 @@ if __name__ == "__main__": "1349129669258448897", "1810188416812019999", "1851981523207299417", + "1853879226987901408", ] for id in ids: try: