mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 15:40:26 +01:00
add TimelineTimelineModule
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
a16f4a6915
commit
1b154a8327
4 changed files with 158 additions and 33 deletions
80
dist/schemas/content.yaml
vendored
80
dist/schemas/content.yaml
vendored
|
|
@ -10,6 +10,7 @@ components:
|
|||
enum:
|
||||
- TimelineTweet
|
||||
- TimelineTimelineCursor
|
||||
- TimelineUser
|
||||
type: string
|
||||
ContentUnion:
|
||||
discriminator:
|
||||
|
|
@ -20,17 +21,19 @@ components:
|
|||
propertyName: entryType
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/TimelineTimelineItem'
|
||||
- $ref: '#/components/schemas/TimelineTimelineCursor'
|
||||
- $ref: '#/components/schemas/TimelineTimelineModule'
|
||||
- $ref: '#/components/schemas/TimelineTimelineCursor'
|
||||
ItemContentUnion:
|
||||
discriminator:
|
||||
mapping":
|
||||
TimelineTimelineCursor: '#/components/schemas/TimelineTimelineCursor'
|
||||
TimelineTweet: '#/components/schemas/TimelineTweet'
|
||||
TimelineUser: '#/components/schemas/TimelineUser'
|
||||
propertyName: itemType
|
||||
oneOf:
|
||||
- $ref: '#/components/schemas/TimelineTweet'
|
||||
- $ref: '#/components/schemas/TimelineTimelineCursor'
|
||||
- $ref: '#/components/schemas/TimelineUser'
|
||||
ItemResult:
|
||||
properties:
|
||||
__typename:
|
||||
|
|
@ -39,6 +42,34 @@ components:
|
|||
$ref: ./tweet.yaml#/components/schemas/TweetUnion
|
||||
required:
|
||||
- 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:
|
||||
properties:
|
||||
__typename:
|
||||
|
|
@ -47,6 +78,8 @@ components:
|
|||
enum:
|
||||
- Top
|
||||
- Bottom
|
||||
- ShowMore
|
||||
- ShowMoreThreads
|
||||
type: string
|
||||
entryType:
|
||||
$ref: '#/components/schemas/ContentEntryType'
|
||||
|
|
@ -81,28 +114,36 @@ components:
|
|||
properties:
|
||||
__typename:
|
||||
$ref: ./typename.yaml#/components/schemas/TypeName
|
||||
clientEventInfo:
|
||||
type: object
|
||||
displayType:
|
||||
type: string
|
||||
entryType:
|
||||
$ref: '#/components/schemas/ContentEntryType'
|
||||
type: string
|
||||
footer:
|
||||
type: object
|
||||
header:
|
||||
type: object
|
||||
items:
|
||||
items:
|
||||
$ref: '#/components/schemas/ModuleItem'
|
||||
type: array
|
||||
required:
|
||||
- __typename
|
||||
- entryType
|
||||
- displayType
|
||||
- items
|
||||
- clientEventInfo
|
||||
TimelineTweet:
|
||||
properties:
|
||||
SocialContext:
|
||||
$ref: '#/components/schemas/SocialContext'
|
||||
__typename:
|
||||
$ref: ./typename.yaml#/components/schemas/TypeName
|
||||
itemType:
|
||||
$ref: '#/components/schemas/ContentItemType'
|
||||
type: string
|
||||
socialContext:
|
||||
properties:
|
||||
contextType:
|
||||
type: string
|
||||
text:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
type: object
|
||||
tweetDisplayType:
|
||||
type: string
|
||||
tweet_results:
|
||||
|
|
@ -112,6 +153,25 @@ components:
|
|||
- itemType
|
||||
- tweetDisplayType
|
||||
- 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:
|
||||
title: Twitter OpenAPI
|
||||
version: 0.0.1
|
||||
|
|
|
|||
1
dist/schemas/typename.yaml
vendored
1
dist/schemas/typename.yaml
vendored
|
|
@ -4,6 +4,7 @@ components:
|
|||
enum:
|
||||
- TimelineTweet
|
||||
- TimelineTimelineItem
|
||||
- TimelineUser
|
||||
- TimelineTimelineCursor
|
||||
- TweetWithVisibilityResults
|
||||
- TimelineTimelineModule
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ components:
|
|||
ContentUnion:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/TimelineTimelineItem"
|
||||
- $ref: "#/components/schemas/TimelineTimelineCursor"
|
||||
- $ref: "#/components/schemas/TimelineTimelineModule"
|
||||
- $ref: "#/components/schemas/TimelineTimelineCursor"
|
||||
discriminator:
|
||||
propertyName: entryType
|
||||
mapping": # deprecated
|
||||
TimelineTimelineItem: "#/components/schemas/TimelineTimelineItem"
|
||||
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
|
||||
TimelineTimelineModule: "#/components/schemas/TimelineTimelineModule"
|
||||
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
|
||||
|
||||
ContentEntryType:
|
||||
type: string
|
||||
|
|
@ -41,6 +41,33 @@ components:
|
|||
feedbackInfo:
|
||||
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:
|
||||
required:
|
||||
- "__typename"
|
||||
|
|
@ -57,21 +84,32 @@ components:
|
|||
$ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor
|
||||
cursorType:
|
||||
type: string
|
||||
enum: [Top, Bottom]
|
||||
enum: [Top, Bottom, ShowMore, ShowMoreThreads]
|
||||
value:
|
||||
type: string
|
||||
|
||||
TimelineTimelineModule:
|
||||
required:
|
||||
- "__typename"
|
||||
- "entryType"
|
||||
properties:
|
||||
__typename:
|
||||
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineModule
|
||||
# ================= Module =================
|
||||
|
||||
entryType:
|
||||
type: string # enum
|
||||
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor
|
||||
ModuleItem:
|
||||
required:
|
||||
- "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 =================
|
||||
|
||||
|
|
@ -79,15 +117,17 @@ components:
|
|||
oneOf:
|
||||
- $ref: "#/components/schemas/TimelineTweet"
|
||||
- $ref: "#/components/schemas/TimelineTimelineCursor"
|
||||
- $ref: "#/components/schemas/TimelineUser"
|
||||
discriminator:
|
||||
propertyName: itemType
|
||||
mapping": # deprecated
|
||||
TimelineTweet: "#/components/schemas/TimelineTweet"
|
||||
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
|
||||
TimelineUser: "#/components/schemas/TimelineUser"
|
||||
|
||||
ContentItemType:
|
||||
type: string
|
||||
enum: [TimelineTweet, TimelineTimelineCursor]
|
||||
enum: [TimelineTweet, TimelineTimelineCursor, TimelineUser]
|
||||
|
||||
TimelineTweet:
|
||||
required:
|
||||
|
|
@ -105,15 +145,28 @@ components:
|
|||
type: string
|
||||
tweet_results:
|
||||
$ref: "#/components/schemas/ItemResult"
|
||||
socialContext:
|
||||
type: object
|
||||
properties:
|
||||
contextType:
|
||||
type: string # enum
|
||||
text:
|
||||
type: string
|
||||
type:
|
||||
type: string # enum
|
||||
SocialContext:
|
||||
$ref: "#/components/schemas/SocialContext"
|
||||
|
||||
TimelineUser:
|
||||
required:
|
||||
- "__typename"
|
||||
- "itemType"
|
||||
- "socialContext"
|
||||
- "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:
|
||||
required:
|
||||
|
|
@ -123,3 +176,13 @@ components:
|
|||
$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
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ components:
|
|||
[
|
||||
TimelineTweet,
|
||||
TimelineTimelineItem,
|
||||
TimelineUser,
|
||||
TimelineTimelineCursor,
|
||||
TweetWithVisibilityResults,
|
||||
TimelineTimelineModule,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue