1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 23:50:26 +01:00

add TimelineTimelineModule

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-04-18 20:22:41 +09:00
parent a16f4a6915
commit 1b154a8327
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
4 changed files with 158 additions and 33 deletions

View file

@ -10,6 +10,7 @@ components:
enum: enum:
- TimelineTweet - TimelineTweet
- TimelineTimelineCursor - TimelineTimelineCursor
- TimelineUser
type: string type: string
ContentUnion: ContentUnion:
discriminator: discriminator:
@ -20,17 +21,19 @@ components:
propertyName: entryType propertyName: entryType
oneOf: oneOf:
- $ref: '#/components/schemas/TimelineTimelineItem' - $ref: '#/components/schemas/TimelineTimelineItem'
- $ref: '#/components/schemas/TimelineTimelineCursor'
- $ref: '#/components/schemas/TimelineTimelineModule' - $ref: '#/components/schemas/TimelineTimelineModule'
- $ref: '#/components/schemas/TimelineTimelineCursor'
ItemContentUnion: ItemContentUnion:
discriminator: discriminator:
mapping": mapping":
TimelineTimelineCursor: '#/components/schemas/TimelineTimelineCursor' TimelineTimelineCursor: '#/components/schemas/TimelineTimelineCursor'
TimelineTweet: '#/components/schemas/TimelineTweet' TimelineTweet: '#/components/schemas/TimelineTweet'
TimelineUser: '#/components/schemas/TimelineUser'
propertyName: itemType propertyName: itemType
oneOf: oneOf:
- $ref: '#/components/schemas/TimelineTweet' - $ref: '#/components/schemas/TimelineTweet'
- $ref: '#/components/schemas/TimelineTimelineCursor' - $ref: '#/components/schemas/TimelineTimelineCursor'
- $ref: '#/components/schemas/TimelineUser'
ItemResult: ItemResult:
properties: properties:
__typename: __typename:
@ -39,6 +42,34 @@ components:
$ref: ./tweet.yaml#/components/schemas/TweetUnion $ref: ./tweet.yaml#/components/schemas/TweetUnion
required: required:
- result - result
ModuleEntry:
properties:
clientEventInfo:
type: object
itemContent:
$ref: '#/components/schemas/ItemContentUnion'
required:
- clientEventInfo
- itemContent
ModuleItem:
properties:
entryId:
pattern: ^[a-z\-]+[0-9]+$
type: string
item:
$ref: '#/components/schemas/ModuleEntry'
required:
- entryId
- item
SocialContext:
properties:
contextType:
type: string
text:
type: string
type:
type: string
type: object
TimelineTimelineCursor: TimelineTimelineCursor:
properties: properties:
__typename: __typename:
@ -47,6 +78,8 @@ components:
enum: enum:
- Top - Top
- Bottom - Bottom
- ShowMore
- ShowMoreThreads
type: string type: string
entryType: entryType:
$ref: '#/components/schemas/ContentEntryType' $ref: '#/components/schemas/ContentEntryType'
@ -81,28 +114,36 @@ components:
properties: properties:
__typename: __typename:
$ref: ./typename.yaml#/components/schemas/TypeName $ref: ./typename.yaml#/components/schemas/TypeName
clientEventInfo:
type: object
displayType:
type: string
entryType: entryType:
$ref: '#/components/schemas/ContentEntryType' $ref: '#/components/schemas/ContentEntryType'
type: string type: string
footer:
type: object
header:
type: object
items:
items:
$ref: '#/components/schemas/ModuleItem'
type: array
required: required:
- __typename - __typename
- entryType - entryType
- displayType
- items
- clientEventInfo
TimelineTweet: TimelineTweet:
properties: properties:
SocialContext:
$ref: '#/components/schemas/SocialContext'
__typename: __typename:
$ref: ./typename.yaml#/components/schemas/TypeName $ref: ./typename.yaml#/components/schemas/TypeName
itemType: itemType:
$ref: '#/components/schemas/ContentItemType' $ref: '#/components/schemas/ContentItemType'
type: string type: string
socialContext:
properties:
contextType:
type: string
text:
type: string
type:
type: string
type: object
tweetDisplayType: tweetDisplayType:
type: string type: string
tweet_results: tweet_results:
@ -112,6 +153,25 @@ components:
- itemType - itemType
- tweetDisplayType - tweetDisplayType
- tweet_results - tweet_results
TimelineUser:
properties:
SocialContext:
$ref: '#/components/schemas/SocialContext'
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
itemType:
$ref: '#/components/schemas/ContentItemType'
type: string
userDisplayType:
type: string
user_results:
$ref: ./user.yaml#/components/schemas/UserResults
required:
- __typename
- itemType
- socialContext
- userDisplayType
- user_results
info: info:
title: Twitter OpenAPI title: Twitter OpenAPI
version: 0.0.1 version: 0.0.1

View file

@ -4,6 +4,7 @@ components:
enum: enum:
- TimelineTweet - TimelineTweet
- TimelineTimelineItem - TimelineTimelineItem
- TimelineUser
- TimelineTimelineCursor - TimelineTimelineCursor
- TweetWithVisibilityResults - TweetWithVisibilityResults
- TimelineTimelineModule - TimelineTimelineModule

View file

@ -9,14 +9,14 @@ components:
ContentUnion: ContentUnion:
oneOf: oneOf:
- $ref: "#/components/schemas/TimelineTimelineItem" - $ref: "#/components/schemas/TimelineTimelineItem"
- $ref: "#/components/schemas/TimelineTimelineCursor"
- $ref: "#/components/schemas/TimelineTimelineModule" - $ref: "#/components/schemas/TimelineTimelineModule"
- $ref: "#/components/schemas/TimelineTimelineCursor"
discriminator: discriminator:
propertyName: entryType propertyName: entryType
mapping": # deprecated mapping": # deprecated
TimelineTimelineItem: "#/components/schemas/TimelineTimelineItem" TimelineTimelineItem: "#/components/schemas/TimelineTimelineItem"
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
TimelineTimelineModule: "#/components/schemas/TimelineTimelineModule" TimelineTimelineModule: "#/components/schemas/TimelineTimelineModule"
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
ContentEntryType: ContentEntryType:
type: string type: string
@ -41,6 +41,33 @@ components:
feedbackInfo: feedbackInfo:
type: object # todo type: object # todo
TimelineTimelineModule:
required:
- "__typename"
- "entryType"
- "displayType"
- "items"
- "clientEventInfo"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineModule
entryType:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor
displayType:
type: string # enum
items:
type: array
items:
$ref: "#/components/schemas/ModuleItem"
footer:
type: object # todo
header:
type: object # todo
clientEventInfo:
type: object # todo
TimelineTimelineCursor: TimelineTimelineCursor:
required: required:
- "__typename" - "__typename"
@ -57,21 +84,32 @@ components:
$ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor $ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor
cursorType: cursorType:
type: string type: string
enum: [Top, Bottom] enum: [Top, Bottom, ShowMore, ShowMoreThreads]
value: value:
type: string type: string
TimelineTimelineModule: # ================= Module =================
required:
- "__typename"
- "entryType"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineModule
entryType: ModuleItem:
type: string # enum required:
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor - "entryId"
- "item"
properties:
entryId:
type: string
pattern: '^[a-z\-]+[0-9]+$'
item:
$ref: "#/components/schemas/ModuleEntry"
ModuleEntry:
required:
- "clientEventInfo"
- "itemContent"
properties:
clientEventInfo:
type: object # todo
itemContent:
$ref: "#/components/schemas/ItemContentUnion"
# ================= ContentItem ================= # ================= ContentItem =================
@ -79,15 +117,17 @@ components:
oneOf: oneOf:
- $ref: "#/components/schemas/TimelineTweet" - $ref: "#/components/schemas/TimelineTweet"
- $ref: "#/components/schemas/TimelineTimelineCursor" - $ref: "#/components/schemas/TimelineTimelineCursor"
- $ref: "#/components/schemas/TimelineUser"
discriminator: discriminator:
propertyName: itemType propertyName: itemType
mapping": # deprecated mapping": # deprecated
TimelineTweet: "#/components/schemas/TimelineTweet" TimelineTweet: "#/components/schemas/TimelineTweet"
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor" TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
TimelineUser: "#/components/schemas/TimelineUser"
ContentItemType: ContentItemType:
type: string type: string
enum: [TimelineTweet, TimelineTimelineCursor] enum: [TimelineTweet, TimelineTimelineCursor, TimelineUser]
TimelineTweet: TimelineTweet:
required: required:
@ -105,15 +145,28 @@ components:
type: string type: string
tweet_results: tweet_results:
$ref: "#/components/schemas/ItemResult" $ref: "#/components/schemas/ItemResult"
socialContext: SocialContext:
type: object $ref: "#/components/schemas/SocialContext"
properties:
contextType: TimelineUser:
type: string # enum required:
text: - "__typename"
type: string - "itemType"
type: - "socialContext"
type: string # enum - "userDisplayType"
- "user_results"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineUser
itemType:
type: string # enum
$ref: "#/components/schemas/ContentItemType" # TimelineUser
SocialContext:
$ref: "#/components/schemas/SocialContext"
userDisplayType:
type: string # enum
user_results:
$ref: "./user.yaml#/components/schemas/UserResults"
ItemResult: ItemResult:
required: required:
@ -123,3 +176,13 @@ components:
$ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet $ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet
result: result:
$ref: "./tweet.yaml#/components/schemas/TweetUnion" $ref: "./tweet.yaml#/components/schemas/TweetUnion"
SocialContext:
type: object
properties:
contextType:
type: string # enum
text:
type: string
type:
type: string # enum

View file

@ -11,6 +11,7 @@ components:
[ [
TimelineTweet, TimelineTweet,
TimelineTimelineItem, TimelineTimelineItem,
TimelineUser,
TimelineTimelineCursor, TimelineTimelineCursor,
TweetWithVisibilityResults, TweetWithVisibilityResults,
TimelineTimelineModule, TimelineTimelineModule,