1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 07:30:37 +01:00
twitter-openapi/src/openapi/schemas/tweet.yaml
ふぁ 8a7eba499f
enum value
Signed-off-by: ふぁ <yuki@yuki0311.com>
2023-09-01 13:58:16 +09:00

506 lines
12 KiB
YAML

openapi: 3.0.3
info:
title: Twitter OpenAPI
version: 0.0.1
paths: {}
components:
schemas:
TweetUnion:
oneOf:
- $ref: "#/components/schemas/Tweet"
- $ref: "#/components/schemas/TweetWithVisibilityResults"
- $ref: "#/components/schemas/TweetTombstone"
discriminator:
propertyName: __typename
mapping": # deprecated
Tweet: "#/components/schemas/Tweet"
TweetWithVisibilityResults: "#/components/schemas/TweetWithVisibilityResults"
TweetTombstone: "#/components/schemas/TweetTombstone"
TweetWithVisibilityResults:
required:
- "__typename"
- "tweet"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TweetWithVisibilityResults
tweet:
$ref: "#/components/schemas/Tweet"
TweetTombstone: #remove tweet
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TweetWithVisibilityResults
additionalProperties: true # todo
Tweet:
required:
- "rest_id"
- "core"
- "edit_control"
# - "edit_prespective"
- "is_translatable"
- "legacy"
- "views"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # null | Tweet
rest_id:
type: string
pattern: "^[0-9]+$"
core:
$ref: "./user.yaml#/components/schemas/UserResultCore"
card:
$ref: "#/components/schemas/TweetCard"
unmention_data:
type: object
additionalProperties: true # todo
edit_control:
$ref: "#/components/schemas/TweetEditControl"
edit_prespective:
$ref: "#/components/schemas/TweetEditPrespective"
is_translatable:
type: boolean
default: false
legacy:
$ref: "#/components/schemas/TweetLegacy"
views:
$ref: "#/components/schemas/TweetView"
quoted_status_result:
$ref: "./content.yaml#/components/schemas/ItemResult"
TweetEditControl:
properties:
edit_tweet_ids:
type: array
items:
type: string
pattern: "^[0-9]+$"
editable_until_msecs:
type: string
pattern: "^[0-9]+$"
is_edit_eligible:
type: boolean
edits_remaining:
type: string
pattern: "^[0-9]+$"
TweetEditPrespective:
properties:
favorited:
type: boolean
retweeted:
type: boolean
TweetView:
required:
- "state"
properties:
count:
type: string
pattern: "^[0-9]+$"
state:
type: string
enum: [EnabledWithCount]
TweetCard:
properties:
rest_id:
type: string
legacy:
$ref: "#/components/schemas/TweetCardLegacy"
TweetCardLegacy:
required:
- "binding_values"
- "name"
- "url"
properties:
name:
type: string
url:
type: string
binding_values:
type: array
items:
$ref: "#/components/schemas/TweetCardLegacyBindingValue"
TweetCardLegacyBindingValue:
required:
- "key"
- "value"
properties:
key:
type: string
value:
$ref: "#/components/schemas/TweetCardLegacyBindingValueData"
TweetCardLegacyBindingValueData:
required:
- "type"
properties:
string_value:
type: string
boolean_value:
type: boolean
scribe_key:
type: string
type:
type: string
TweetLegacy:
required:
- "bookmark_count"
- "bookmarked"
- "conversation_id_str"
- "created_at"
- "display_text_range"
- "entities"
- "favorite_count"
- "favorited"
- "full_text"
- "is_quote_status"
- "lang"
- "quote_count"
- "reply_count"
- "retweet_count"
- "retweeted"
- "user_id_str"
- "id_str"
properties:
bookmark_count:
type: integer
bookmarked:
type: boolean
created_at:
$ref: "./general.yaml#/components/schemas/TwitterTimeFormat"
conversation_id_str:
type: string
pattern: "^[0-9]+$"
display_text_range:
type: array
items:
type: integer
entities:
$ref: "#/components/schemas/Entities"
favorite_count:
type: integer
favorited:
type: boolean
full_text:
type: string
is_quote_status:
type: boolean
lang:
type: string # enum
possibly_sensitive:
type: boolean
default: false
possibly_sensitive_editable:
type: boolean
default: false
quote_count:
type: integer
reply_count:
type: integer
retweet_count:
type: integer
retweeted:
type: boolean
retweeted_status_result:
$ref: "./content.yaml#/components/schemas/ItemResult"
user_id_str:
type: string
pattern: "^[0-9]+$"
id_str:
type: string
pattern: "^[0-9]+$"
self_thread:
$ref: "#/components/schemas/SelfThread"
extended_entities:
$ref: "#/components/schemas/ExtendedEntities"
SelfThread:
required:
- "id_str"
properties:
id_str:
type: string
pattern: "^[0-9]+$"
Entities:
required:
- "hashtags"
- "symbols"
- "user_mentions"
- "urls"
properties:
hashtags:
type: array
items:
$ref: "#/components/schemas/Hashtag"
symbols:
type: array
items:
$ref: "#/components/schemas/Symbol"
user_mentions:
type: array
items:
$ref: "#/components/schemas/UserMention"
urls:
type: array
items:
$ref: "#/components/schemas/Url"
media:
type: array
items:
$ref: "#/components/schemas/Media"
Hashtag:
type: object
additionalProperties: true # todo
Symbol:
type: object
additionalProperties: true # todo
UserMention:
type: object
additionalProperties: true # todo
Url:
type: object
required:
- "url"
- "indices"
- "expanded_url"
- "display_url"
properties:
display_url:
type: string
expanded_url:
type: string
format: uri
url:
type: string
format: uri
indices:
type: array
items:
type: integer
Media:
required:
- "display_url"
- "expanded_url"
- "id_str"
- "indices"
- "media_url_https"
- "type"
- "url"
- "features"
- "sizes"
- "original_info"
properties:
display_url:
type: string
format: uri
expanded_url:
type: string
format: uri
id_str:
type: string
pattern: "^[0-9]+$"
indices:
type: array
items:
type: integer
media_url_https:
type: string
format: uri
type:
type: string
enum: [photo]
url:
type: string
format: uri
features:
type: object
sizes:
$ref: "#/components/schemas/MediaSizes"
original_info:
$ref: "#/components/schemas/MediaOriginalInfo"
ExtendedEntities:
required:
- "media"
properties:
media:
type: array
items:
$ref: "#/components/schemas/MediaExtended"
MediaExtended:
required:
- "display_url"
- "expanded_url"
- "id_str"
- "indices"
- "media_key"
- "media_url_https"
- "type"
- "url"
- "ext_media_availability"
- "features"
- "sizes"
- "original_info"
properties:
display_url:
type: string
format: uri
expanded_url:
type: string
format: uri
id_str:
type: string
pattern: "^[0-9]+$"
indices:
type: array
items:
type: integer
media_key:
type: string
media_url_https:
type: string
format: uri
type:
type: string
enum: [photo, video, animated_gif]
url:
type: string
format: uri
additional_media_info:
$ref: "#/components/schemas/AdditionalMediaInfo"
mediaStats:
$ref: "#/components/schemas/mediaStats"
ext_media_availability:
$ref: "#/components/schemas/extMediaAvailability"
features:
type: object
sizes:
$ref: "#/components/schemas/MediaSizes"
original_info:
$ref: "#/components/schemas/MediaOriginalInfo"
video_info:
$ref: "#/components/schemas/MediaVideoInfo"
MediaOriginalInfo:
required:
- "height"
- "width"
properties:
height:
type: integer
width:
type: integer
focus_rects:
type: array
items:
$ref: "#/components/schemas/MediaOriginalInfoFocusRect"
MediaOriginalInfoFocusRect:
type: object
required:
- "x"
- "y"
- "w"
- "h"
properties:
x:
type: integer
y:
type: integer
w:
type: integer
h:
type: integer
MediaVideoInfo:
required:
- "aspect_ratio"
- "variants"
properties:
aspect_ratio:
type: array
items:
type: integer
duration_millis:
type: integer
variants:
type: array
items:
$ref: "#/components/schemas/MediaVideoInfoVariant"
MediaVideoInfoVariant:
required:
- "content_type"
- "url"
properties:
bitrate:
type: integer
content_type:
type: string
url:
type: string
format: uri
AdditionalMediaInfo:
required:
- "monetizable"
properties:
monetizable:
type: boolean
mediaStats:
required:
- "viewCount"
properties:
viewCount:
type: integer
extMediaAvailability:
required:
- "status"
properties:
status:
type: string
enum: [Available]
MediaSizes:
required:
- "large"
- "medium"
- "small"
- "thumb"
properties:
large:
$ref: "#/components/schemas/MediaSize"
medium:
$ref: "#/components/schemas/MediaSize"
small:
$ref: "#/components/schemas/MediaSize"
thumb:
$ref: "#/components/schemas/MediaSize"
MediaSize:
required:
- "w"
- "h"
- "resize"
properties:
w:
type: integer
h:
type: integer
resize:
type: string
enum: [crop, fit]