refact: openapi splitted into separate files
This commit is contained in:
parent
9ed09500ed
commit
2025bb451f
22 changed files with 443 additions and 435 deletions
29
api/paths/titles-id.yaml
Normal file
29
api/paths/titles-id.yaml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
get:
|
||||
summary: Get title description
|
||||
parameters:
|
||||
- in: path
|
||||
name: title_id
|
||||
required: true
|
||||
schema:
|
||||
type: integer
|
||||
format: int64
|
||||
- in: query
|
||||
name: fields
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
responses:
|
||||
'200':
|
||||
description: Title description
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "../schemas/Title.yaml"
|
||||
'404':
|
||||
description: Title not found
|
||||
'400':
|
||||
description: Request params are not correct
|
||||
'500':
|
||||
description: Unknown server error
|
||||
'204':
|
||||
description: No title found
|
||||
73
api/paths/titles.yaml
Normal file
73
api/paths/titles.yaml
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
get:
|
||||
summary: Get titles
|
||||
parameters:
|
||||
- $ref: ../parameters/cursor.yaml
|
||||
- $ref: ../parameters/title_sort.yaml
|
||||
- in: query
|
||||
name: sort_forward
|
||||
schema:
|
||||
type: boolean
|
||||
default: true
|
||||
- in: query
|
||||
name: word
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: status
|
||||
schema:
|
||||
$ref: '../schemas/enums/TitleStatus.yaml'
|
||||
- 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: '../schemas/enums/ReleaseSeason.yaml'
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 10
|
||||
- in: query
|
||||
name: offset
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 0
|
||||
- in: query
|
||||
name: fields
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
responses:
|
||||
'200':
|
||||
description: List of titles with cursor
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
type: array
|
||||
items:
|
||||
$ref: '../schemas/Title.yaml'
|
||||
description: List of titles
|
||||
cursor:
|
||||
$ref: '../schemas/CursorObj.yaml'
|
||||
required:
|
||||
- data
|
||||
- cursor
|
||||
'204':
|
||||
description: No titles found
|
||||
'400':
|
||||
description: Request params are not correct
|
||||
'500':
|
||||
description: Unknown server error
|
||||
61
api/paths/users-id-titles.yaml
Normal file
61
api/paths/users-id-titles.yaml
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
get:
|
||||
summary: Get user titles
|
||||
parameters:
|
||||
- $ref: '../parameters/cursor.yaml'
|
||||
- in: path
|
||||
name: user_id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: word
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: status
|
||||
schema:
|
||||
$ref: '../schemas/enums/TitleStatus.yaml'
|
||||
- in: query
|
||||
name: watch_status
|
||||
schema:
|
||||
$ref: '../schemas/enums/UserTitleStatus.yaml'
|
||||
- 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: '../schemas/enums/ReleaseSeason.yaml'
|
||||
- in: query
|
||||
name: limit
|
||||
schema:
|
||||
type: integer
|
||||
format: int32
|
||||
default: 10
|
||||
- in: query
|
||||
name: fields
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
responses:
|
||||
'200':
|
||||
description: List of user titles
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '../schemas/UserTitle.yaml'
|
||||
'204':
|
||||
description: No titles found
|
||||
'400':
|
||||
description: Request params are not correct
|
||||
'500':
|
||||
description: Unknown server error
|
||||
26
api/paths/users-id.yaml
Normal file
26
api/paths/users-id.yaml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
get:
|
||||
summary: Get user info
|
||||
parameters:
|
||||
- in: path
|
||||
name: user_id
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
schema:
|
||||
type: string
|
||||
default: all
|
||||
responses:
|
||||
'200':
|
||||
description: User info
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '../schemas/User.yaml'
|
||||
'404':
|
||||
description: User not found
|
||||
'400':
|
||||
description: Request params are not correct
|
||||
'500':
|
||||
description: Unknown server error
|
||||
Loading…
Add table
Add a link
Reference in a new issue