1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-12 08:00:27 +01:00

add TweetDetail

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-04-18 19:07:40 +09:00
parent abbcbe8b86
commit a16f4a6915
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
9 changed files with 297 additions and 61 deletions

View file

@ -35,7 +35,7 @@ components:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineItem
itemContent:
$ref: "#/components/schemas/ItemContent"
$ref: "#/components/schemas/ItemContentUnion"
clientEventInfo:
type: object # todo
feedbackInfo:
@ -44,7 +44,6 @@ components:
TimelineTimelineCursor:
required:
- "__typename"
- "entryType"
- "cursorType"
- "value"
properties:
@ -52,7 +51,10 @@ components:
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineCursor
entryType:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor
$ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor
itemType:
type: string # enum
$ref: "#/components/schemas/ContentEntryType" # null | TimelineTimelineCursor
cursorType:
type: string
enum: [Top, Bottom]
@ -72,11 +74,22 @@ components:
$ref: "#/components/schemas/ContentEntryType" # TimelineTimelineCursor
# ================= ContentItem =================
ItemContentUnion:
oneOf:
- $ref: "#/components/schemas/TimelineTweet"
- $ref: "#/components/schemas/TimelineTimelineCursor"
discriminator:
propertyName: itemType
mapping": # deprecated
TimelineTweet: "#/components/schemas/TimelineTweet"
TimelineTimelineCursor: "#/components/schemas/TimelineTimelineCursor"
ContentItemType:
type: string
enum: [TimelineTweet]
enum: [TimelineTweet, TimelineTimelineCursor]
ItemContent:
TimelineTweet:
required:
- "__typename"
- "itemType"
@ -106,5 +119,7 @@ components:
required:
- "result"
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet
result:
$ref: "./tweet.yaml#/components/schemas/TweetUnion"

View file

@ -11,16 +11,24 @@ components:
- $ref: "#/components/schemas/TimelineAddEntries"
- $ref: "#/components/schemas/TimelineClearCache"
- $ref: "#/components/schemas/TimelinePinEntry"
- $ref: "#/components/schemas/TimelineTerminateTimeline"
discriminator:
propertyName: type
mapping": # deprecated
TimelineAddEntries: "#/components/schemas/TimelineAddEntries"
TimelineClearCache: "#/components/schemas/TimelineClearCache"
TimelinePinEntry: "#/components/schemas/TimelinePinEntry"
TimelineTerminateTimeline: "#/components/schemas/TimelineTerminateTimeline"
InstructionType:
type: string
enum: [TimelineAddEntries, TimelineClearCache, TimelinePinEntry]
enum:
[
TimelineAddEntries,
TimelineClearCache,
TimelinePinEntry,
TimelineTerminateTimeline,
]
TimelineAddEntries:
required:
@ -54,6 +62,18 @@ components:
entry:
$ref: "#/components/schemas/TimelineAddEntry"
TimelineTerminateTimeline:
required:
- type
- direction
properties:
type:
type: string
$ref: "#/components/schemas/InstructionType" # TimelineTerminateTimeline
direction:
type: string
enum: [Top, Bottom]
TimelineAddEntry:
required:
- "content"

View file

@ -29,7 +29,6 @@ components:
Tweet:
required:
# - "__typename"
- "rest_id"
- "core"
- "edit_control"
@ -40,7 +39,7 @@ components:
properties:
__typename:
$ref: "./typename.yaml#/components/schemas/TypeName" # Tweet
$ref: "./typename.yaml#/components/schemas/TypeName" # null | Tweet
rest_id:
type: string
pattern: "^[0-9]+$"