From dd0869a6f5cc1b471dcda819dd216ec7ff3dca8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sun, 23 Apr 2023 07:57:30 +0900 Subject: [PATCH] add Entities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/schemas/tweet.yaml | 99 ++++++++++++++++++++++++++++++- src/openapi/schemas/tweet.yaml | 103 ++++++++++++++++++++++++++++++++- 2 files changed, 200 insertions(+), 2 deletions(-) diff --git a/dist/schemas/tweet.yaml b/dist/schemas/tweet.yaml index 1c709da..eff5faf 100644 --- a/dist/schemas/tweet.yaml +++ b/dist/schemas/tweet.yaml @@ -1,5 +1,96 @@ components: schemas: + Entities: + properties: + hashtags: + items: + $ref: '#/components/schemas/Hashtag' + type: array + media: + items: + $ref: '#/components/schemas/Media' + type: array + symbols: + items: + $ref: '#/components/schemas/Symbol' + type: array + urls: + items: + $ref: '#/components/schemas/Url' + type: array + user_mentions: + items: + $ref: '#/components/schemas/UserMention' + type: array + required: + - hashtags + - symbols + - user_mentions + - urls + - media + ExtendedEntities: + properties: + media: + items: + $ref: '#/components/schemas/Media' + type: array + required: + - media + Hashtag: + type: object + Media: + properties: + display_url: + format: uri + type: string + expanded_url: + format: uri + type: string + ext_media_availability: + type: object + id_str: + pattern: ^[0-9]+$ + type: string + indices: + items: + type: integer + type: array + media_key: + pattern: ^[0-9]+_[0-9]+$ + type: string + media_url_https: + format: uri + type: string + original_info: + properties: + focus_rects: + items: + type: object + type: array + height: + type: integer + width: + type: integer + type: object + sizes: + type: object + type: + type: string + url: + format: uri + type: string + required: + - id_str + - indices + - media_url_https + - url + - display_url + - expanded_url + - type + - sizes + - original_info + Symbol: + type: object Tweet: properties: __typename: @@ -73,7 +164,9 @@ components: type: integer type: array entities: - type: object + $ref: '#/components/schemas/Entities' + extended_entities: + $ref: '#/components/schemas/ExtendedEntities' favorite_count: type: integer favorited: @@ -148,6 +241,10 @@ components: required: - __typename - tweet + Url: + type: object + UserMention: + type: object info: title: Twitter OpenAPI version: 0.0.1 diff --git a/src/openapi/schemas/tweet.yaml b/src/openapi/schemas/tweet.yaml index bd0e730..0dbfb38 100644 --- a/src/openapi/schemas/tweet.yaml +++ b/src/openapi/schemas/tweet.yaml @@ -128,7 +128,7 @@ components: items: type: integer entities: - type: object + $ref: "#/components/schemas/Entities" favorite_count: type: integer favorited: @@ -161,3 +161,104 @@ components: id_str: type: string pattern: "^[0-9]+$" + extended_entities: + $ref: "#/components/schemas/ExtendedEntities" + + Entities: + required: + - "hashtags" + - "symbols" + - "user_mentions" + - "urls" + - "media" + 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 # todo + Symbol: + type: object # todo + UserMention: + type: object # todo + Url: + type: object # todo + + ExtendedEntities: + required: + - "media" + properties: + media: + type: array + items: + $ref: "#/components/schemas/Media" + + Media: + required: + - "id_str" + - "indices" + - "media_url_https" + - "url" + - "display_url" + - "expanded_url" + - "type" + - "sizes" + - "original_info" + properties: + id_str: + type: string + pattern: "^[0-9]+$" + indices: + type: array + items: + type: integer + media_url_https: + type: string + format: uri + url: + type: string + format: uri + display_url: + type: string + format: uri + expanded_url: + type: string + format: uri + type: + type: string # enum + sizes: + type: object # todo + original_info: + type: object + properties: + height: + type: integer + width: + type: integer + focus_rects: + type: array + items: + type: object # todo + media_key: + type: string + pattern: "^[0-9]+_[0-9]+$" + ext_media_availability: + type: object # todo