feat: more fields for titles and refactored schemas

This commit is contained in:
Iron_Felix 2025-11-16 01:47:11 +03:00
parent 4949a3c25f
commit e18f4a44c3
2 changed files with 101 additions and 41 deletions

View file

@ -2,8 +2,10 @@ openapi: 3.1.1
info:
title: Titles, Users, Reviews, Tags, and Media API
version: 1.0.0
servers:
- url: /api/v1
paths:
/title:
get:
@ -63,6 +65,7 @@ paths:
description: Request params are not correct
'500':
description: Unknown server error
# /title/{title_id}:
# get:
# summary: Get title description
@ -569,6 +572,7 @@ components:
- finished
- ongoing
- planned
ReleaseSeason:
type: string
description: Title release season
@ -577,6 +581,7 @@ components:
- spring
- summer
- fall
UserTitleStatus:
type: string
description: User's title status
@ -585,8 +590,57 @@ components:
- planned
- dropped
- in-progress
Review:
type: object
additionalProperties: true
Tag:
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: "少女"
Tags:
type: array
description: "Array of localized tags"
items:
$ref: '#/components/schemas/Tag'
example:
- en: "Shojo"
ru: "Сёдзё"
ja: "少女"
- en: "Shounen"
ru: "Сёнен"
ja: "少年"
Studio:
type: object
properties:
id:
type: integer
format: int64
name:
type: string
poster_id:
type: integer
format: int64
poster_path:
type: string
description:
type: string
Title:
type: object
required:
- id
- title_names
- tags
properties:
id:
type: integer
@ -607,11 +661,10 @@ components:
en: ["Attack on Titan", "AoT"]
ru: ["Атака титанов", "Титаны"]
ja: ["進撃の巨人"]
studio_id:
type: integer
format: int64
studio_name:
type: string
studio:
$ref: '#/components/schemas/Studio'
tags:
$ref: '#/components/schemas/Tags'
poster_id:
type: integer
format: int64
@ -640,6 +693,7 @@ components:
type: number
format: double
additionalProperties: true
User:
type: object
properties:
@ -683,12 +737,7 @@ components:
- user_id
- nickname
# - creation_date
UserTitle:
type: object
additionalProperties: true
Review:
type: object
additionalProperties: true
Tag:
type: object
additionalProperties: true