mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 15:40:26 +01:00
commit
d88cc73308
10 changed files with 419 additions and 7 deletions
2
.github/workflows/test-build.yaml
vendored
2
.github/workflows/test-build.yaml
vendored
|
|
@ -39,7 +39,7 @@ jobs:
|
||||||
|
|
||||||
- name: Get Openapi Generator
|
- name: Get Openapi Generator
|
||||||
run: |
|
run: |
|
||||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.3.0/openapi-generator-cli-7.3.0.jar -O openapi-generator-cli.jar --no-verbose
|
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -O openapi-generator-cli.jar --no-verbose
|
||||||
if: steps.openapi-generator-cache.outputs.cache-hit != 'true'
|
if: steps.openapi-generator-cache.outputs.cache-hit != 'true'
|
||||||
|
|
||||||
# Python Setup
|
# Python Setup
|
||||||
|
|
|
||||||
2
.github/workflows/test-python.yaml
vendored
2
.github/workflows/test-python.yaml
vendored
|
|
@ -40,7 +40,7 @@ jobs:
|
||||||
|
|
||||||
- name: Get Openapi Generator
|
- name: Get Openapi Generator
|
||||||
run: |
|
run: |
|
||||||
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.3.0/openapi-generator-cli-7.3.0.jar -O openapi-generator-cli.jar --no-verbose
|
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -O openapi-generator-cli.jar --no-verbose
|
||||||
if: steps.openapi-generator-cache.outputs.cache-hit != 'true'
|
if: steps.openapi-generator-cache.outputs.cache-hit != 'true'
|
||||||
|
|
||||||
# Python Setup
|
# Python Setup
|
||||||
|
|
|
||||||
4
.vscode/tasks.json
vendored
4
.vscode/tasks.json
vendored
|
|
@ -32,14 +32,14 @@
|
||||||
"command": [
|
"command": [
|
||||||
"python3 -m venv .venv;",
|
"python3 -m venv .venv;",
|
||||||
".venv/bin/python3 -m pip install -r requirements.txt;",
|
".venv/bin/python3 -m pip install -r requirements.txt;",
|
||||||
"wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.3.0/openapi-generator-cli-7.3.0.jar -O openapi-generator-cli.jar;"
|
"wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -O openapi-generator-cli.jar;"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"windows": {
|
"windows": {
|
||||||
"command": [
|
"command": [
|
||||||
"python -m venv .venv;",
|
"python -m venv .venv;",
|
||||||
".venv/Scripts/python -m pip install -r requirements.txt;",
|
".venv/Scripts/python -m pip install -r requirements.txt;",
|
||||||
"Invoke-WebRequest https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.3.0/openapi-generator-cli-7.3.0.jar -OutFile openapi-generator-cli.jar;"
|
"Invoke-WebRequest https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.4.0/openapi-generator-cli-7.4.0.jar -OutFile openapi-generator-cli.jar;"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
102
dist/compatible/openapi-3.0.yaml
vendored
102
dist/compatible/openapi-3.0.yaml
vendored
|
|
@ -29,6 +29,100 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- url
|
- url
|
||||||
|
Article:
|
||||||
|
properties:
|
||||||
|
article_results:
|
||||||
|
$ref: '#/components/schemas/ArticleResults'
|
||||||
|
required:
|
||||||
|
- article_results
|
||||||
|
ArticleCoverMedia:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
media_id:
|
||||||
|
pattern: ^[0-9]+$
|
||||||
|
type: string
|
||||||
|
media_info:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaInfo'
|
||||||
|
media_key:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- media_key
|
||||||
|
- media_id
|
||||||
|
- media_info
|
||||||
|
ArticleCoverMediaColorInfo:
|
||||||
|
properties:
|
||||||
|
palette:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfoPalette'
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- palette
|
||||||
|
ArticleCoverMediaColorInfoPalette:
|
||||||
|
properties:
|
||||||
|
percentage:
|
||||||
|
type: number
|
||||||
|
rgb:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfoPaletteRGB'
|
||||||
|
required:
|
||||||
|
- percentage
|
||||||
|
- rgb
|
||||||
|
ArticleCoverMediaColorInfoPaletteRGB:
|
||||||
|
properties:
|
||||||
|
blue:
|
||||||
|
type: integer
|
||||||
|
green:
|
||||||
|
type: integer
|
||||||
|
red:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- blue
|
||||||
|
- green
|
||||||
|
- red
|
||||||
|
ArticleCoverMediaInfo:
|
||||||
|
properties:
|
||||||
|
__typename:
|
||||||
|
$ref: '#/components/schemas/TypeName'
|
||||||
|
color_info:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfo'
|
||||||
|
original_img_height:
|
||||||
|
type: integer
|
||||||
|
original_img_url:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
original_img_width:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- original_img_height
|
||||||
|
- original_img_width
|
||||||
|
- original_img_url
|
||||||
|
- color_info
|
||||||
|
ArticleResult:
|
||||||
|
properties:
|
||||||
|
cover_media:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMedia'
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
preview_text:
|
||||||
|
type: string
|
||||||
|
rest_id:
|
||||||
|
pattern: ^[0-9]+$
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- rest_id
|
||||||
|
- id
|
||||||
|
- title
|
||||||
|
- preview_text
|
||||||
|
- cover_media
|
||||||
|
ArticleResults:
|
||||||
|
properties:
|
||||||
|
result:
|
||||||
|
$ref: '#/components/schemas/ArticleResult'
|
||||||
|
required:
|
||||||
|
- result
|
||||||
AuthorCommunityRelationship:
|
AuthorCommunityRelationship:
|
||||||
properties:
|
properties:
|
||||||
community_results:
|
community_results:
|
||||||
|
|
@ -1763,6 +1857,11 @@ components:
|
||||||
socialContext:
|
socialContext:
|
||||||
$ref: '#/components/schemas/SocialContextUnion'
|
$ref: '#/components/schemas/SocialContextUnion'
|
||||||
tweetDisplayType:
|
tweetDisplayType:
|
||||||
|
enum:
|
||||||
|
- Tweet
|
||||||
|
- SelfThread
|
||||||
|
- MediaGrid
|
||||||
|
- CondensedTweet
|
||||||
type: string
|
type: string
|
||||||
tweet_results:
|
tweet_results:
|
||||||
$ref: '#/components/schemas/ItemResult'
|
$ref: '#/components/schemas/ItemResult'
|
||||||
|
|
@ -1842,6 +1941,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: '#/components/schemas/TypeName'
|
$ref: '#/components/schemas/TypeName'
|
||||||
|
article:
|
||||||
|
$ref: '#/components/schemas/Article'
|
||||||
author_community_relationship:
|
author_community_relationship:
|
||||||
$ref: '#/components/schemas/AuthorCommunityRelationship'
|
$ref: '#/components/schemas/AuthorCommunityRelationship'
|
||||||
birdwatch_pivot:
|
birdwatch_pivot:
|
||||||
|
|
@ -2352,6 +2453,7 @@ components:
|
||||||
- CommunityTweetPinActionUnavailable
|
- CommunityTweetPinActionUnavailable
|
||||||
- CommunityInvitesUnavailable
|
- CommunityInvitesUnavailable
|
||||||
- CommunityJoinRequestsUnavailable
|
- CommunityJoinRequestsUnavailable
|
||||||
|
- ApiImage
|
||||||
type: string
|
type: string
|
||||||
UnfavoriteTweet:
|
UnfavoriteTweet:
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
102
dist/compatible_discriminator/openapi-3.0.yaml
vendored
102
dist/compatible_discriminator/openapi-3.0.yaml
vendored
|
|
@ -29,6 +29,100 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- url
|
- url
|
||||||
|
Article:
|
||||||
|
properties:
|
||||||
|
article_results:
|
||||||
|
$ref: '#/components/schemas/ArticleResults'
|
||||||
|
required:
|
||||||
|
- article_results
|
||||||
|
ArticleCoverMedia:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
media_id:
|
||||||
|
pattern: ^[0-9]+$
|
||||||
|
type: string
|
||||||
|
media_info:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaInfo'
|
||||||
|
media_key:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- media_key
|
||||||
|
- media_id
|
||||||
|
- media_info
|
||||||
|
ArticleCoverMediaColorInfo:
|
||||||
|
properties:
|
||||||
|
palette:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfoPalette'
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- palette
|
||||||
|
ArticleCoverMediaColorInfoPalette:
|
||||||
|
properties:
|
||||||
|
percentage:
|
||||||
|
type: number
|
||||||
|
rgb:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfoPaletteRGB'
|
||||||
|
required:
|
||||||
|
- percentage
|
||||||
|
- rgb
|
||||||
|
ArticleCoverMediaColorInfoPaletteRGB:
|
||||||
|
properties:
|
||||||
|
blue:
|
||||||
|
type: integer
|
||||||
|
green:
|
||||||
|
type: integer
|
||||||
|
red:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- blue
|
||||||
|
- green
|
||||||
|
- red
|
||||||
|
ArticleCoverMediaInfo:
|
||||||
|
properties:
|
||||||
|
__typename:
|
||||||
|
$ref: '#/components/schemas/TypeName'
|
||||||
|
color_info:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfo'
|
||||||
|
original_img_height:
|
||||||
|
type: integer
|
||||||
|
original_img_url:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
original_img_width:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- original_img_height
|
||||||
|
- original_img_width
|
||||||
|
- original_img_url
|
||||||
|
- color_info
|
||||||
|
ArticleResult:
|
||||||
|
properties:
|
||||||
|
cover_media:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMedia'
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
preview_text:
|
||||||
|
type: string
|
||||||
|
rest_id:
|
||||||
|
pattern: ^[0-9]+$
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- rest_id
|
||||||
|
- id
|
||||||
|
- title
|
||||||
|
- preview_text
|
||||||
|
- cover_media
|
||||||
|
ArticleResults:
|
||||||
|
properties:
|
||||||
|
result:
|
||||||
|
$ref: '#/components/schemas/ArticleResult'
|
||||||
|
required:
|
||||||
|
- result
|
||||||
AuthorCommunityRelationship:
|
AuthorCommunityRelationship:
|
||||||
properties:
|
properties:
|
||||||
community_results:
|
community_results:
|
||||||
|
|
@ -1763,6 +1857,11 @@ components:
|
||||||
socialContext:
|
socialContext:
|
||||||
$ref: '#/components/schemas/SocialContextUnion'
|
$ref: '#/components/schemas/SocialContextUnion'
|
||||||
tweetDisplayType:
|
tweetDisplayType:
|
||||||
|
enum:
|
||||||
|
- Tweet
|
||||||
|
- SelfThread
|
||||||
|
- MediaGrid
|
||||||
|
- CondensedTweet
|
||||||
type: string
|
type: string
|
||||||
tweet_results:
|
tweet_results:
|
||||||
$ref: '#/components/schemas/ItemResult'
|
$ref: '#/components/schemas/ItemResult'
|
||||||
|
|
@ -1842,6 +1941,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: '#/components/schemas/TypeName'
|
$ref: '#/components/schemas/TypeName'
|
||||||
|
article:
|
||||||
|
$ref: '#/components/schemas/Article'
|
||||||
author_community_relationship:
|
author_community_relationship:
|
||||||
$ref: '#/components/schemas/AuthorCommunityRelationship'
|
$ref: '#/components/schemas/AuthorCommunityRelationship'
|
||||||
birdwatch_pivot:
|
birdwatch_pivot:
|
||||||
|
|
@ -2352,6 +2453,7 @@ components:
|
||||||
- CommunityTweetPinActionUnavailable
|
- CommunityTweetPinActionUnavailable
|
||||||
- CommunityInvitesUnavailable
|
- CommunityInvitesUnavailable
|
||||||
- CommunityJoinRequestsUnavailable
|
- CommunityJoinRequestsUnavailable
|
||||||
|
- ApiImage
|
||||||
type: string
|
type: string
|
||||||
UnfavoriteTweet:
|
UnfavoriteTweet:
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
102
dist/docs/openapi-3.0.yaml
vendored
102
dist/docs/openapi-3.0.yaml
vendored
|
|
@ -29,6 +29,100 @@ components:
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- url
|
- url
|
||||||
|
Article:
|
||||||
|
properties:
|
||||||
|
article_results:
|
||||||
|
$ref: '#/components/schemas/ArticleResults'
|
||||||
|
required:
|
||||||
|
- article_results
|
||||||
|
ArticleCoverMedia:
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
media_id:
|
||||||
|
pattern: ^[0-9]+$
|
||||||
|
type: string
|
||||||
|
media_info:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaInfo'
|
||||||
|
media_key:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
- media_key
|
||||||
|
- media_id
|
||||||
|
- media_info
|
||||||
|
ArticleCoverMediaColorInfo:
|
||||||
|
properties:
|
||||||
|
palette:
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfoPalette'
|
||||||
|
type: array
|
||||||
|
required:
|
||||||
|
- palette
|
||||||
|
ArticleCoverMediaColorInfoPalette:
|
||||||
|
properties:
|
||||||
|
percentage:
|
||||||
|
type: number
|
||||||
|
rgb:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfoPaletteRGB'
|
||||||
|
required:
|
||||||
|
- percentage
|
||||||
|
- rgb
|
||||||
|
ArticleCoverMediaColorInfoPaletteRGB:
|
||||||
|
properties:
|
||||||
|
blue:
|
||||||
|
type: integer
|
||||||
|
green:
|
||||||
|
type: integer
|
||||||
|
red:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- blue
|
||||||
|
- green
|
||||||
|
- red
|
||||||
|
ArticleCoverMediaInfo:
|
||||||
|
properties:
|
||||||
|
__typename:
|
||||||
|
$ref: '#/components/schemas/TypeName'
|
||||||
|
color_info:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMediaColorInfo'
|
||||||
|
original_img_height:
|
||||||
|
type: integer
|
||||||
|
original_img_url:
|
||||||
|
format: uri
|
||||||
|
type: string
|
||||||
|
original_img_width:
|
||||||
|
type: integer
|
||||||
|
required:
|
||||||
|
- original_img_height
|
||||||
|
- original_img_width
|
||||||
|
- original_img_url
|
||||||
|
- color_info
|
||||||
|
ArticleResult:
|
||||||
|
properties:
|
||||||
|
cover_media:
|
||||||
|
$ref: '#/components/schemas/ArticleCoverMedia'
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
preview_text:
|
||||||
|
type: string
|
||||||
|
rest_id:
|
||||||
|
pattern: ^[0-9]+$
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- rest_id
|
||||||
|
- id
|
||||||
|
- title
|
||||||
|
- preview_text
|
||||||
|
- cover_media
|
||||||
|
ArticleResults:
|
||||||
|
properties:
|
||||||
|
result:
|
||||||
|
$ref: '#/components/schemas/ArticleResult'
|
||||||
|
required:
|
||||||
|
- result
|
||||||
AuthorCommunityRelationship:
|
AuthorCommunityRelationship:
|
||||||
properties:
|
properties:
|
||||||
community_results:
|
community_results:
|
||||||
|
|
@ -1763,6 +1857,11 @@ components:
|
||||||
socialContext:
|
socialContext:
|
||||||
$ref: '#/components/schemas/SocialContextUnion'
|
$ref: '#/components/schemas/SocialContextUnion'
|
||||||
tweetDisplayType:
|
tweetDisplayType:
|
||||||
|
enum:
|
||||||
|
- Tweet
|
||||||
|
- SelfThread
|
||||||
|
- MediaGrid
|
||||||
|
- CondensedTweet
|
||||||
type: string
|
type: string
|
||||||
tweet_results:
|
tweet_results:
|
||||||
$ref: '#/components/schemas/ItemResult'
|
$ref: '#/components/schemas/ItemResult'
|
||||||
|
|
@ -1842,6 +1941,8 @@ components:
|
||||||
properties:
|
properties:
|
||||||
__typename:
|
__typename:
|
||||||
$ref: '#/components/schemas/TypeName'
|
$ref: '#/components/schemas/TypeName'
|
||||||
|
article:
|
||||||
|
$ref: '#/components/schemas/Article'
|
||||||
author_community_relationship:
|
author_community_relationship:
|
||||||
$ref: '#/components/schemas/AuthorCommunityRelationship'
|
$ref: '#/components/schemas/AuthorCommunityRelationship'
|
||||||
birdwatch_pivot:
|
birdwatch_pivot:
|
||||||
|
|
@ -2352,6 +2453,7 @@ components:
|
||||||
- CommunityTweetPinActionUnavailable
|
- CommunityTweetPinActionUnavailable
|
||||||
- CommunityInvitesUnavailable
|
- CommunityInvitesUnavailable
|
||||||
- CommunityJoinRequestsUnavailable
|
- CommunityJoinRequestsUnavailable
|
||||||
|
- ApiImage
|
||||||
type: string
|
type: string
|
||||||
UnfavoriteTweet:
|
UnfavoriteTweet:
|
||||||
properties:
|
properties:
|
||||||
|
|
|
||||||
|
|
@ -197,6 +197,7 @@ components:
|
||||||
$ref: "#/components/schemas/ContentItemType" # TimelineTweet
|
$ref: "#/components/schemas/ContentItemType" # TimelineTweet
|
||||||
tweetDisplayType:
|
tweetDisplayType:
|
||||||
type: string
|
type: string
|
||||||
|
enum: [Tweet, SelfThread, MediaGrid, CondensedTweet]
|
||||||
tweet_results:
|
tweet_results:
|
||||||
$ref: "#/components/schemas/ItemResult"
|
$ref: "#/components/schemas/ItemResult"
|
||||||
socialContext:
|
socialContext:
|
||||||
|
|
|
||||||
|
|
@ -165,6 +165,8 @@ components:
|
||||||
type: boolean
|
type: boolean
|
||||||
author_community_relationship:
|
author_community_relationship:
|
||||||
$ref: "#/components/schemas/AuthorCommunityRelationship"
|
$ref: "#/components/schemas/AuthorCommunityRelationship"
|
||||||
|
article:
|
||||||
|
$ref: "#/components/schemas/Article"
|
||||||
|
|
||||||
TweetEditControl:
|
TweetEditControl:
|
||||||
properties:
|
properties:
|
||||||
|
|
@ -1312,3 +1314,105 @@ components:
|
||||||
type: integer
|
type: integer
|
||||||
text:
|
text:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
Article:
|
||||||
|
required:
|
||||||
|
- "article_results"
|
||||||
|
properties:
|
||||||
|
article_results:
|
||||||
|
$ref: "#/components/schemas/ArticleResults"
|
||||||
|
|
||||||
|
ArticleResults:
|
||||||
|
required:
|
||||||
|
- "result"
|
||||||
|
properties:
|
||||||
|
result:
|
||||||
|
$ref: "#/components/schemas/ArticleResult"
|
||||||
|
|
||||||
|
ArticleResult:
|
||||||
|
required:
|
||||||
|
- "rest_id"
|
||||||
|
- "id"
|
||||||
|
- "title"
|
||||||
|
- "preview_text"
|
||||||
|
- "cover_media"
|
||||||
|
properties:
|
||||||
|
rest_id:
|
||||||
|
type: string
|
||||||
|
pattern: "^[0-9]+$"
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
preview_text:
|
||||||
|
type: string
|
||||||
|
cover_media:
|
||||||
|
$ref: "#/components/schemas/ArticleCoverMedia"
|
||||||
|
|
||||||
|
ArticleCoverMedia:
|
||||||
|
required:
|
||||||
|
- "id"
|
||||||
|
- "media_key"
|
||||||
|
- "media_id"
|
||||||
|
- "media_info"
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: string
|
||||||
|
media_key:
|
||||||
|
type: string
|
||||||
|
media_id:
|
||||||
|
type: string
|
||||||
|
pattern: "^[0-9]+$"
|
||||||
|
media_info:
|
||||||
|
$ref: "#/components/schemas/ArticleCoverMediaInfo"
|
||||||
|
|
||||||
|
ArticleCoverMediaInfo:
|
||||||
|
required:
|
||||||
|
- "original_img_height"
|
||||||
|
- "original_img_width"
|
||||||
|
- "original_img_url"
|
||||||
|
- "color_info"
|
||||||
|
properties:
|
||||||
|
__typename:
|
||||||
|
$ref: "./typename.yaml#/components/schemas/TypeName" # ApiImage
|
||||||
|
original_img_height:
|
||||||
|
type: integer
|
||||||
|
original_img_width:
|
||||||
|
type: integer
|
||||||
|
original_img_url:
|
||||||
|
type: string
|
||||||
|
format: uri
|
||||||
|
color_info:
|
||||||
|
$ref: "#/components/schemas/ArticleCoverMediaColorInfo"
|
||||||
|
|
||||||
|
ArticleCoverMediaColorInfo:
|
||||||
|
required:
|
||||||
|
- "palette"
|
||||||
|
properties:
|
||||||
|
palette:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: "#/components/schemas/ArticleCoverMediaColorInfoPalette"
|
||||||
|
|
||||||
|
ArticleCoverMediaColorInfoPalette:
|
||||||
|
required:
|
||||||
|
- "percentage"
|
||||||
|
- "rgb"
|
||||||
|
properties:
|
||||||
|
percentage:
|
||||||
|
type: number
|
||||||
|
rgb:
|
||||||
|
$ref: "#/components/schemas/ArticleCoverMediaColorInfoPaletteRGB"
|
||||||
|
|
||||||
|
ArticleCoverMediaColorInfoPaletteRGB:
|
||||||
|
required:
|
||||||
|
- "blue"
|
||||||
|
- "green"
|
||||||
|
- "red"
|
||||||
|
properties:
|
||||||
|
blue:
|
||||||
|
type: integer
|
||||||
|
green:
|
||||||
|
type: integer
|
||||||
|
red:
|
||||||
|
type: integer
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,5 @@ components:
|
||||||
CommunityTweetPinActionUnavailable,
|
CommunityTweetPinActionUnavailable,
|
||||||
CommunityInvitesUnavailable,
|
CommunityInvitesUnavailable,
|
||||||
CommunityJoinRequestsUnavailable,
|
CommunityJoinRequestsUnavailable,
|
||||||
|
ApiImage,
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import traceback
|
||||||
import warnings
|
import warnings
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import aenum
|
from enum import Enum
|
||||||
import openapi_client as pt
|
import openapi_client as pt
|
||||||
|
|
||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
|
|
@ -84,9 +84,9 @@ def match_rate_zero(a, b, base, key):
|
||||||
|
|
||||||
|
|
||||||
def match_rate(a, b, base, key=""):
|
def match_rate(a, b, base, key=""):
|
||||||
if isinstance(a, aenum.Enum):
|
if isinstance(a, Enum):
|
||||||
a = a.value
|
a = a.value
|
||||||
if isinstance(b, aenum.Enum):
|
if isinstance(b, Enum):
|
||||||
b = b.value
|
b = b.value
|
||||||
if a is None and b is False:
|
if a is None and b is False:
|
||||||
return 1
|
return 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue