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

Add retry_after property to error response and update SocialContext schema

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2024-02-13 00:16:51 +09:00
parent d103390271
commit 44772ab7b5
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
3 changed files with 57 additions and 7 deletions

View file

@ -32,6 +32,7 @@ components:
- kind - kind
- name - name
- source - source
- retry_after
- tracing - tracing
properties: properties:
message: message:
@ -54,6 +55,8 @@ components:
type: string type: string
source: source:
type: string type: string
retry_after:
type: integer
tracing: tracing:
$ref: "#/components/schemas/Tracing" $ref: "#/components/schemas/Tracing"

View file

@ -191,7 +191,7 @@ components:
tweet_results: tweet_results:
$ref: "#/components/schemas/ItemResult" $ref: "#/components/schemas/ItemResult"
socialContext: socialContext:
$ref: "#/components/schemas/SocialContext" $ref: "#/components/schemas/SocialContextUnion"
promotedMetadata: promotedMetadata:
type: object type: object
additionalProperties: true # todo additionalProperties: true # todo
@ -210,7 +210,7 @@ components:
itemType: itemType:
$ref: "#/components/schemas/ContentItemType" # TimelineUser $ref: "#/components/schemas/ContentItemType" # TimelineUser
socialContext: socialContext:
$ref: "#/components/schemas/SocialContext" $ref: "#/components/schemas/SocialContextUnion"
userDisplayType: userDisplayType:
type: string type: string
enum: [User, UserDetailed, SubscribableUser] enum: [User, UserDetailed, SubscribableUser]
@ -224,20 +224,66 @@ components:
result: result:
$ref: "./tweet.yaml#/components/schemas/TweetUnion" $ref: "./tweet.yaml#/components/schemas/TweetUnion"
SocialContext: SocialContextUnion:
oneOf:
- $ref: "#/components/schemas/TimelineGeneralContext"
- $ref: "#/components/schemas/TimelineTopicContext"
discriminator:
propertyName: type
mapping": # deprecated
TimelineGeneralContext: "#/components/schemas/TimelineGeneralContext"
TimelineTopicContext: "#/components/schemas/TimelineTopicContext"
SocialContextUnionType:
type: string
enum:
- TimelineGeneralContext
- TimelineTopicContext
TimelineGeneralContext:
type: object type: object
properties: properties:
type:
$ref: "#/components/schemas/SocialContextUnionType"
contextType: contextType:
type: string # enum type: string # enum
enum: ["Follow", "Pin"] enum: ["Follow", "Pin", "Like", "Location", "Sparkle"]
text: text:
type: string type: string
type:
type: string # enum
enum: ["TimelineGeneralContext"]
landingUrl: landingUrl:
$ref: "#/components/schemas/SocialContextLandingUrl" $ref: "#/components/schemas/SocialContextLandingUrl"
TimelineTopicContext:
type: object
properties:
type:
$ref: "#/components/schemas/SocialContextUnionType"
topic:
$ref: "#/components/schemas/TopicContext"
functionalityType:
type: string
enum: ["Basic"]
TopicContext:
type: object
properties:
id:
type: string
topic_id:
type: string
name:
type: string
description:
type: string
icon_url:
type: string
format: uri
following:
type: boolean
not_interested:
type: boolean
SocialContextLandingUrl: SocialContextLandingUrl:
type: object type: object
properties: properties:

View file

@ -79,6 +79,7 @@ components:
enum: enum:
- "Circle" - "Circle"
- "Square" - "Square"
- "Hexagon"
professional: professional:
$ref: "#/components/schemas/UserProfessional" $ref: "#/components/schemas/UserProfessional"
user_seed_tweet_count: user_seed_tweet_count: