refact: openapi splitted into separate files
This commit is contained in:
parent
9ed09500ed
commit
2025bb451f
22 changed files with 443 additions and 435 deletions
9
api/schemas/CursorObj.yaml
Normal file
9
api/schemas/CursorObj.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
param:
|
||||
type: string
|
||||
9
api/schemas/Image.yaml
Normal file
9
api/schemas/Image.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
storage_type:
|
||||
type: string
|
||||
image_path:
|
||||
type: string
|
||||
2
api/schemas/Review.yaml
Normal file
2
api/schemas/Review.yaml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
type: object
|
||||
additionalProperties: true
|
||||
14
api/schemas/Studio.yaml
Normal file
14
api/schemas/Studio.yaml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
name:
|
||||
type: string
|
||||
poster:
|
||||
$ref: ./Image.yaml
|
||||
description:
|
||||
type: string
|
||||
8
api/schemas/Tag.yaml
Normal file
8
api/schemas/Tag.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
type: object
|
||||
description: 'A localized tag: keys are language codes (ISO 639-1), values are tag names'
|
||||
additionalProperties:
|
||||
type: string
|
||||
example:
|
||||
en: Shojo
|
||||
ru: Сёдзё
|
||||
ja: 少女
|
||||
11
api/schemas/Tags.yaml
Normal file
11
api/schemas/Tags.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
type: array
|
||||
description: Array of localized tags
|
||||
items:
|
||||
$ref: ./Tag.yaml
|
||||
example:
|
||||
- en: Shojo
|
||||
ru: Сёдзё
|
||||
ja: 少女
|
||||
- en: Shounen
|
||||
ru: Сёнен
|
||||
ja: 少年
|
||||
63
api/schemas/Title.yaml
Normal file
63
api/schemas/Title.yaml
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
type: object
|
||||
required:
|
||||
- id
|
||||
- title_names
|
||||
- tags
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unique title ID (primary key)
|
||||
example: 1
|
||||
title_names:
|
||||
type: object
|
||||
description: Localized titles. Key = language (ISO 639-1), value = list of names
|
||||
additionalProperties:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
example: Attack on Titan
|
||||
minItems: 1
|
||||
example:
|
||||
- Attack on Titan
|
||||
- AoT
|
||||
example:
|
||||
en:
|
||||
- Attack on Titan
|
||||
- AoT
|
||||
ru:
|
||||
- Атака титанов
|
||||
- Титаны
|
||||
ja:
|
||||
- 進撃の巨人
|
||||
studio:
|
||||
$ref: ./Studio.yaml
|
||||
tags:
|
||||
$ref: ./Tags.yaml
|
||||
poster:
|
||||
$ref: ./Image.yaml
|
||||
title_status:
|
||||
$ref: ./enums/TitleStatus.yaml
|
||||
rating:
|
||||
type: number
|
||||
format: double
|
||||
rating_count:
|
||||
type: integer
|
||||
format: int32
|
||||
release_year:
|
||||
type: integer
|
||||
format: int32
|
||||
release_season:
|
||||
$ref: ./enums/ReleaseSeason.yaml
|
||||
episodes_aired:
|
||||
type: integer
|
||||
format: int32
|
||||
episodes_all:
|
||||
type: integer
|
||||
format: int32
|
||||
episodes_len:
|
||||
type: object
|
||||
additionalProperties:
|
||||
type: number
|
||||
format: double
|
||||
additionalProperties: true
|
||||
8
api/schemas/TitleSort.yaml
Normal file
8
api/schemas/TitleSort.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
type: string
|
||||
description: Title sort order
|
||||
default: id
|
||||
enum:
|
||||
- id
|
||||
- year
|
||||
- rating
|
||||
- views
|
||||
40
api/schemas/User.yaml
Normal file
40
api/schemas/User.yaml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
type: object
|
||||
properties:
|
||||
id:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Unique user ID (primary key)
|
||||
example: 1
|
||||
avatar_id:
|
||||
type: integer
|
||||
format: int64
|
||||
description: ID of the user avatar (references images table)
|
||||
example: null
|
||||
mail:
|
||||
type: string
|
||||
format: email
|
||||
description: User email
|
||||
example: john.doe@example.com
|
||||
nickname:
|
||||
type: string
|
||||
description: Username (alphanumeric + _ or -)
|
||||
maxLength: 16
|
||||
example: john_doe_42
|
||||
disp_name:
|
||||
type: string
|
||||
description: Display name
|
||||
maxLength: 32
|
||||
example: John Doe
|
||||
user_desc:
|
||||
type: string
|
||||
description: User description
|
||||
maxLength: 512
|
||||
example: Just a regular user.
|
||||
creation_date:
|
||||
type: string
|
||||
format: date-time
|
||||
description: Timestamp when the user was created
|
||||
example: '2025-10-10T23:45:47.908073Z'
|
||||
required:
|
||||
- user_id
|
||||
- nickname
|
||||
24
api/schemas/UserTitle.yaml
Normal file
24
api/schemas/UserTitle.yaml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
type: object
|
||||
required:
|
||||
- user_id
|
||||
- title_id
|
||||
- status
|
||||
properties:
|
||||
user_id:
|
||||
type: integer
|
||||
format: int64
|
||||
title_id:
|
||||
type: integer
|
||||
format: int64
|
||||
status:
|
||||
$ref: ./enums/UserTitleStatus.yaml
|
||||
rate:
|
||||
type: integer
|
||||
format: int32
|
||||
review_id:
|
||||
type: integer
|
||||
format: int64
|
||||
ctime:
|
||||
type: string
|
||||
format: date-time
|
||||
additionalProperties: true
|
||||
26
api/schemas/_index.yaml
Normal file
26
api/schemas/_index.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
CursorObj:
|
||||
$ref: ./CursorObj.yaml
|
||||
TitleSort:
|
||||
$ref: "./TitleSort.yaml"
|
||||
Image:
|
||||
$ref: "./Image.yaml"
|
||||
TitleStatus:
|
||||
$ref: "./enums/TitleStatus.yaml"
|
||||
ReleaseSeason:
|
||||
$ref: "./enums/ReleaseSeason.yaml"
|
||||
UserTitleStatus:
|
||||
$ref: "./enums/UserTitleStatus.yaml"
|
||||
Review:
|
||||
$ref: "./Review.yaml"
|
||||
Tag:
|
||||
$ref: "./Tag.yaml"
|
||||
Tags:
|
||||
$ref: "./Tags.yaml"
|
||||
Studio:
|
||||
$ref: "./Studio.yaml"
|
||||
Title:
|
||||
$ref: "./Title.yaml"
|
||||
User:
|
||||
$ref: "./User.yaml"
|
||||
UserTitle:
|
||||
$ref: "./UserTitle.yaml"
|
||||
7
api/schemas/enums/ReleaseSeason.yaml
Normal file
7
api/schemas/enums/ReleaseSeason.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
type: string
|
||||
description: Title release season
|
||||
enum:
|
||||
- winter
|
||||
- spring
|
||||
- summer
|
||||
- fall
|
||||
6
api/schemas/enums/TitleStatus.yaml
Normal file
6
api/schemas/enums/TitleStatus.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
type: string
|
||||
description: Title status
|
||||
enum:
|
||||
- finished
|
||||
- ongoing
|
||||
- planned
|
||||
7
api/schemas/enums/UserTitleStatus.yaml
Normal file
7
api/schemas/enums/UserTitleStatus.yaml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
type: string
|
||||
description: User's title status
|
||||
enum:
|
||||
- finished
|
||||
- planned
|
||||
- dropped
|
||||
- in-progress
|
||||
Loading…
Add table
Add a link
Reference in a new issue