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

fix models

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-04-14 02:43:25 +09:00
parent 1fa94d4c08
commit 8229a7fd12
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA

View file

@ -568,12 +568,33 @@ components:
- "result" - "result"
properties: properties:
result: result:
$ref: "#/components/schemas/TweetResult" $ref: "#/components/schemas/TweetUnion"
# ================= Tweet ================= # ================= Tweet =================
TweetResult:
TweetUnion:
oneOf:
- $ref: "#/components/schemas/Tweet"
- $ref: "#/components/schemas/TweetWithVisibilityResults"
discriminator:
propertyName: __typename
mapping": # deprecated
Tweet: "#/components/schemas/Tweet"
TweetWithVisibilityResults: "#/components/schemas/TweetWithVisibilityResults"
TweetWithVisibilityResults:
required: required:
- "__typename" - "__typename"
- "tweet"
properties:
__typename:
$ref: "#/components/schemas/TypeName" # TweetWithVisibilityResults
tweet:
$ref: "#/components/schemas/Tweet"
Tweet:
required:
# - "__typename"
- "rest_id" - "rest_id"
- "core" - "core"
- "edit_control" - "edit_control"
@ -584,7 +605,7 @@ components:
properties: properties:
__typename: __typename:
$ref: "#/components/schemas/TypeName" # Tweet TweetWithVisibilityResults $ref: "#/components/schemas/TypeName" # Tweet
rest_id: rest_id:
type: string type: string
pattern: "^[0-9]+$" pattern: "^[0-9]+$"
@ -708,9 +729,17 @@ components:
- "result" - "result"
properties: properties:
result: result:
$ref: "#/components/schemas/UserResult" $ref: "#/components/schemas/UserUnion"
UserResult: UserUnion:
oneOf:
- $ref: "#/components/schemas/User"
discriminator:
propertyName: __typename
mapping": # deprecated
User: "#/components/schemas/User"
User:
required: required:
- "__typename" - "__typename"
- "affiliates_highlighted_label" - "affiliates_highlighted_label"
@ -762,8 +791,12 @@ components:
- "blocking" - "blocking"
- "can_dm" - "can_dm"
- "can_media_tag" - "can_media_tag"
- "created_at"
- "default_profile" - "default_profile"
- "default_profile_image" - "default_profile_image"
- "description"
- "entities"
- "fast_followers_count"
- "favourites_count" - "favourites_count"
- "follow_request_sent" - "follow_request_sent"
- "followed_by" - "followed_by"
@ -773,8 +806,10 @@ components:
- "has_custom_timelines" - "has_custom_timelines"
- "is_translator" - "is_translator"
- "listed_count" - "listed_count"
- "location"
- "media_count" - "media_count"
- "muting" - "muting"
- "name"
- "normal_followers_count" - "normal_followers_count"
- "notifications" - "notifications"
- "pinned_tweet_ids_str" - "pinned_tweet_ids_str"
@ -783,6 +818,7 @@ components:
- "profile_interstitial_type" - "profile_interstitial_type"
- "protected" - "protected"
- "screen_name" - "screen_name"
- "status"
- "statuses_count" - "statuses_count"
- "translator_type" - "translator_type"
- "verified" - "verified"
@ -868,10 +904,12 @@ components:
type: object type: object
profile_banner_url: profile_banner_url:
type: string type: string
format: uri
profile_image_extensions: profile_image_extensions:
type: object type: object
profile_image_url_https: profile_image_url_https:
type: string type: string
format: uri
profile_interstitial_type: profile_interstitial_type:
type: string type: string
protected: protected: