- Upgrade schema

- Add constants
- Add default
- Add set default for request payload
- Fixes
This commit is contained in:
2023-08-22 17:46:51 +03:00
parent d713dab392
commit fb9fd9880e
17 changed files with 3775 additions and 1186 deletions

View File

@ -5,10 +5,11 @@ info:
description: For generate API REST clients for Feelter UGC
contact:
email: garin1221@yandex.ru
version: 1.0.0
version: 0.0.2
servers:
- url: https://www.youtubekids.com/youtubei/v1
description: Original YoutubeKids API Server V1
tags:
- name: browse
@ -37,8 +38,8 @@ paths:
'application/json':
"schema":
$ref: '#/components/schemas/BrowseResponsePayload'
'400':
description: Bad Request
default:
description: Unexpected error
content:
'application/json':
"schema":
@ -52,6 +53,8 @@ components:
# Ошибка
Error:
type: object
required:
- message
properties:
message:
type: string
@ -104,6 +107,8 @@ components:
# Текст -> Runs
TextRun:
type: object
required:
- text
properties:
text:
type: string
@ -113,6 +118,8 @@ components:
# Текст
Text:
type: object
required:
- runs
properties:
runs:
type: array
@ -124,6 +131,9 @@ components:
# Строковый параметр ключ-зачение
KeyStringValue:
type: object
required:
- key
- value
properties:
key:
type: string
@ -133,6 +143,8 @@ components:
# Ассеты категории
CategoryAssets:
type: object
required:
- assetKey
properties:
assetKey:
type: string
@ -142,6 +154,8 @@ components:
# Расширение для владельцев детских видео
KidsVideoOwnerExtension:
type: object
required:
- externalChannelId
properties:
externalChannelId:
type: string
@ -149,17 +163,27 @@ components:
# Thumbnail
Thumbnail:
type: object
required:
- url
- width
- height
properties:
url:
type: string
width:
type: number
type: integer
height:
type: number
type: integer
# Компактный видеорендерер
# Рендер карточки с видео
CompactVideoRenderer:
type: object
required:
- videoId
- title
- viewCountText
- trackingParams
- kidsVideoOwnerExtension
properties:
videoId:
type: string
@ -200,15 +224,107 @@ components:
kidsVideoOwnerExtension:
$ref: '#/components/schemas/KidsVideoOwnerExtension'
# Рендер карточки с плейлистом
CompactPlaylistRenderer:
type: object
required:
- playlistId
- title
- viewCountText
- trackingParams
properties:
playlistId:
type: string
thumbnail:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
title:
$ref: '#/components/schemas/Text'
shortBylineText:
$ref: '#/components/schemas/Text'
videoCountText:
$ref: '#/components/schemas/Text'
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
videoCountShortText:
$ref: '#/components/schemas/Text'
trackingParams:
type: string
sidebarThumbnails:
type: array
items:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
thumbnailText:
$ref: '#/components/schemas/Text'
shareUrl:
type: string
longBylineText:
$ref: '#/components/schemas/Text'
tvBanner:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
# Рендер карточки с каналом
CompactChannelRenderer:
type: object
required:
- channelId
- displayName
- videoCountText
- title
- trackingParams
properties:
channelId:
type: string
thumbnail:
type: object
properties:
thumbnails:
type: array
items:
$ref: '#/components/schemas/Thumbnail'
displayName:
$ref: '#/components/schemas/Text'
videoCountText:
$ref: '#/components/schemas/Text'
subscriberCountText:
$ref: '#/components/schemas/Text'
navigationEndpoint:
$ref: '#/components/schemas/NavigationEndpoint'
title:
$ref: '#/components/schemas/Text'
trackingParams:
type: string
# Средство визуализации раздела элемента
ItemSectionRenderer:
type: object
required:
- contents
- trackingParams
properties:
contents:
type: array
items:
type: object
properties:
compactPlaylistRenderer:
$ref: '#/components/schemas/CompactPlaylistRenderer'
compactChannelRenderer:
$ref: '#/components/schemas/CompactChannelRenderer'
compactVideoRenderer:
$ref: '#/components/schemas/CompactVideoRenderer'
trackingParams:
@ -275,13 +391,29 @@ components:
# Параметры контента
KidsAppContentSettings:
type: object
required:
- corpusPreference
- kidsNoSearchMode
properties:
corpusPreference:
type: string
enum:
- KIDS_CORPUS_PREFERENCE_UNKNOWN # unknown
- KIDS_CORPUS_PREFERENCE_YOUNGER # (0-4 years)
- KIDS_CORPUS_PREFERENCE_TWEEN # (5-7)
- KIDS_CORPUS_PREFERENCE_PAM_YOUNGER
- KIDS_CORPUS_PREFERENCE_PAM_TWEEN
- KIDS_CORPUS_PREFERENCE_PRESCHOOL # (8-12)
example: KIDS_CORPUS_PREFERENCE_TWEEN
default: KIDS_CORPUS_PREFERENCE_TWEEN
kidsNoSearchMode:
type: string
enum:
- YT_KIDS_NO_SEARCH_MODE_UNKNOWN # unknown
- YT_KIDS_NO_SEARCH_MODE_ON
- YT_KIDS_NO_SEARCH_MODE_OFF
example: YT_KIDS_NO_SEARCH_MODE_OFF
default: YT_KIDS_NO_SEARCH_MODE_OFF
# Конфигурация категорий
KidsAppCategorySettings:
@ -307,39 +439,51 @@ components:
RequestClient:
type: object
description: Client information
required:
- kidsAppInfo
properties:
clientName:
type: string
example: WEB_KIDS
default: WEB_KIDS
clientVersion:
type: string
example: 2.20230202.00.00
example: 2.20230817.00.00
default: 2.20230817.00.00
hl:
type: string
example: ru
default: ru
gl:
type: string
example: RU
default: RU
experimentsToken:
type: string
browserName:
type: string
example: Safari
default: Safari
deviceMake:
type: string
example: apple
default: apple
browserVersion:
type: string
example: '16.2'
default: '16.2'
osName:
type: string
example: Macintosh
default: Macintosh
osVersion:
type: string
example: 10_15_7
example: '10_15_7'
default: '10_15_7'
platform:
type: string
example: DESKTOP
default: DESKTOP
kidsAppInfo:
$ref: '#/components/schemas/KidsAppInfo'
@ -347,6 +491,8 @@ components:
RequestContext:
type: object
description: Request context
required:
- client
properties:
client:
$ref: '#/components/schemas/RequestClient'
@ -359,7 +505,7 @@ components:
visitorData:
type: string
maxAgeSeconds:
type: number
type: integer
serviceTrackingParams:
type: array
items:
@ -375,9 +521,14 @@ components:
# Данные для запроса на получение контента определенного ресурса
BrowseRequestPayload:
type: object
required:
- context
- browseId
properties:
context:
$ref: '#/components/schemas/RequestContext'
params:
type: string
browseId:
type: string
example: FEkids_home
@ -385,6 +536,10 @@ components:
# Ответ на запрос получения контента определенного ресурса
BrowseResponsePayload:
type: object
required:
- header
- contents
- responseContext
properties:
responseContext:
$ref: '#/components/schemas/ResponseContext'
@ -404,12 +559,18 @@ components:
# Ответ с ошибкой
ErrorResponsePayload:
type: object
required:
- error
properties:
error:
type: object
required:
- code
- status
- message
properties:
code:
type: number
type: integer
example: 400
message:
type: string