openapi: 3.0.3 info: title: Twitter OpenAPI version: 0.0.1 paths: {} components: schemas: ContentUnion: oneOf: - $ref: "#/components/schemas/TimelineTimelineItem" - $ref: "#/components/schemas/TimelineTimelineModule" - $ref: "#/components/schemas/TimelineTimelineCursor" discriminator: propertyName: entryType mapping": # deprecated TimelineTimelineItem: "#/components/schemas/TimelineTimelineItem" TimelineTimelineModule: "#/components/schemas/TimelineTimelineModule" TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor" ContentEntryType: type: string enum: [TimelineTimelineItem, TimelineTimelineCursor, TimelineTimelineModule] CursorType: type: string enum: [Top, Bottom, ShowMore, ShowMoreThreads, Gap] # Gap??? TimelineTimelineItem: required: - "__typename" - "entryType" - "itemContent" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineItem entryType: $ref: "#/components/schemas/ContentEntryType" # TimelineTimelineItem itemContent: $ref: "#/components/schemas/ItemContentUnion" clientEventInfo: $ref: "#/components/schemas/ClientEventInfo" feedbackInfo: type: object additionalProperties: true # todo TimelineTimelineModule: required: - "__typename" - "entryType" - "displayType" # - "items" - "clientEventInfo" properties: __typename: type: string $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineModule entryType: $ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor displayType: type: string enum: [Vertical, VerticalConversation] items: type: array items: $ref: "#/components/schemas/ModuleItem" footer: type: object additionalProperties: true # todo header: type: object additionalProperties: true # todo clientEventInfo: type: object additionalProperties: true # todo TimelineTimelineCursor: required: - "__typename" - "cursorType" - "value" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineCursor entryType: $ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor itemType: $ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor cursorType: $ref: "#/components/schemas/CursorType" value: type: string # ================= Module ================= ModuleItem: required: - "entryId" - "item" properties: entryId: type: string pattern: "^(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+" item: $ref: "#/components/schemas/ModuleEntry" ModuleEntry: required: - "clientEventInfo" - "itemContent" properties: clientEventInfo: $ref: "#/components/schemas/ClientEventInfo" itemContent: $ref: "#/components/schemas/ItemContentUnion" # ================= ContentItem ================= ItemContentUnion: oneOf: - $ref: "#/components/schemas/TimelineTweet" - $ref: "#/components/schemas/TimelineTimelineCursor" - $ref: "#/components/schemas/TimelineUser" - $ref: "#/components/schemas/TimelinePrompt" - $ref: "#/components/schemas/TimelineMessagePrompt" discriminator: propertyName: __typename mapping": # deprecated TimelineTweet: "#/components/schemas/TimelineTweet" TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor" TimelineUser: "#/components/schemas/TimelineUser" TimelinePrompt: "#/components/schemas/TimelinePrompt" TimelineMessagePrompt: "#/components/schemas/TimelineMessagePrompt" ContentItemType: type: string enum: [ TimelineTweet, TimelineTimelineCursor, TimelineUser, TimelinePrompt, TimelineMessagePrompt, ] TimelineTweet: required: - "__typename" - "itemType" - "tweetDisplayType" - "tweet_results" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTweet itemType: $ref: "#/components/schemas/ContentItemType" # TimelineTweet tweetDisplayType: type: string tweet_results: $ref: "#/components/schemas/ItemResult" SocialContext: $ref: "#/components/schemas/SocialContext" promotedMetadata: type: object additionalProperties: true # todo TimelineUser: required: - "__typename" - "itemType" - "socialContext" - "userDisplayType" - "user_results" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineUser itemType: $ref: "#/components/schemas/ContentItemType" # TimelineUser SocialContext: $ref: "#/components/schemas/SocialContext" userDisplayType: type: string enum: [User, UserDetailed, SubscribableUser] user_results: $ref: "./user.yaml#/components/schemas/UserResults" ItemResult: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet result: $ref: "./tweet.yaml#/components/schemas/TweetUnion" SocialContext: type: object properties: contextType: type: string # enum text: type: string type: type: string # enum TimelinePrompt: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelinePrompt additionalProperties: true # todo TimelineMessagePrompt: properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineMessagePrompt additionalProperties: true # todo ClientEventInfo: properties: component: # enum half_cover type: string element: type: string # august-2023-privacy-prompt-candidate # pattern: "(([a-z]+|[0-9]+|[0-9a-f]+)(-|$))+" # pattern: "^(january|february|march|april|may|june|july|august|september|october|november|december)-[0-9]{4}-([a-z]-)+[a-z]+$" details: type: object additionalProperties: true # todo