From 7fed5ed53665466a8da575a0a9b83978ecc85c7b Mon Sep 17 00:00:00 2001 From: Iron_Felix Date: Fri, 14 Nov 2025 23:57:34 +0300 Subject: [PATCH] feat: get titles added with all components needed --- api/openapi.yaml | 151 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 117 insertions(+), 34 deletions(-) diff --git a/api/openapi.yaml b/api/openapi.yaml index 6439c86..c1aed30 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -5,40 +5,60 @@ info: servers: - url: /api/v1 paths: - # /title: - # get: - # summary: Get titles - # parameters: - # - in: query - # name: query - # schema: - # type: string - # - in: query - # name: limit - # schema: - # type: integer - # default: 10 - # - in: query - # name: offset - # schema: - # type: integer - # default: 0 - # - in: query - # name: fields - # schema: - # type: string - # default: all - # responses: - # '200': - # description: List of titles - # content: - # application/json: - # schema: - # type: array - # items: - # $ref: '#/components/schemas/Title' - # '204': - # description: No titles found + /title: + get: + summary: Get titles + parameters: + - in: query + name: word + schema: + type: string + - in: query + name: status + schema: + $ref: '#/components/schemas/TitleStatus' + - in: query + name: rating + schema: + type: number + format: double + - in: query + name: release_year + schema: + type: integer + format: int32 + - in: query + name: release_season + schema: + $ref: '#/components/schemas/ReleaseSeason' + - in: query + name: limit + schema: + type: integer + default: 10 + - in: query + name: offset + schema: + type: integer + default: 0 + - in: query + name: fields + schema: + type: string + default: all + responses: + '200': + description: List of titles + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Title' + '204': + description: No titles found + '500': + description: Unknown server error # /title/{title_id}: # get: @@ -535,8 +555,71 @@ paths: components: schemas: + TitleStatus: + type: string + description: Title status + enum: + - finished + - ongoing + - planned + ReleaseSeason: + type: string + description: Title release season + enum: + - winter + - spring + - summer + - fall + UserTitleStatus: + type: string + description: User's title status + enum: + - finished + - planned + - dropped + - in-progress Title: type: object + properties: + id: + type: integer + format: int64 + description: Unique title ID (primary key) + example: 1 + title_names: + type: array + items: + type: string + studio_id: + type: integer + format: int64 + poster_id: + type: integer + format: int64 + title_status: + $ref: '#/components/schemas/TitleStatus' + rating: + type: number + format: double + rating_count: + type: integer + format: int32 + release_year: + type: integer + format: int32 + release_season: + $ref: '#/components/schemas/ReleaseSeason' + episodes_aired: + type: integer + format: int32 + episodes_all: + type: integer + format: int32 + episodes_len: + type: array + items: + type: number + format: double additionalProperties: true User: type: object