refact: slightly refactored openapi spec
This commit is contained in:
parent
cdfa14cece
commit
9ed09500ed
1 changed files with 26 additions and 412 deletions
438
api/openapi.yaml
438
api/openapi.yaml
|
|
@ -1,4 +1,4 @@
|
||||||
openapi: 3.1.1
|
openapi: 3.0.4
|
||||||
info:
|
info:
|
||||||
title: Titles, Users, Reviews, Tags, and Media API
|
title: Titles, Users, Reviews, Tags, and Media API
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
|
@ -15,9 +15,9 @@ paths:
|
||||||
- $ref: '#/components/parameters/title_sort'
|
- $ref: '#/components/parameters/title_sort'
|
||||||
- in: query
|
- in: query
|
||||||
name: sort_forward
|
name: sort_forward
|
||||||
default: true
|
|
||||||
schema:
|
schema:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
default: true
|
||||||
- in: query
|
- in: query
|
||||||
name: word
|
name: word
|
||||||
schema:
|
schema:
|
||||||
|
|
@ -59,13 +59,22 @@ paths:
|
||||||
default: all
|
default: all
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
description: List of titles
|
description: List of titles with cursor
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: array
|
type: object
|
||||||
items:
|
properties:
|
||||||
$ref: '#/components/schemas/Title'
|
data:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/Title'
|
||||||
|
description: List of titles
|
||||||
|
cursor:
|
||||||
|
$ref: "#/components/schemas/CursorObj"
|
||||||
|
required:
|
||||||
|
- data
|
||||||
|
- cursor
|
||||||
'204':
|
'204':
|
||||||
description: No titles found
|
description: No titles found
|
||||||
'400':
|
'400':
|
||||||
|
|
@ -104,66 +113,6 @@ paths:
|
||||||
'204':
|
'204':
|
||||||
description: No title found
|
description: No title found
|
||||||
|
|
||||||
# patch:
|
|
||||||
# summary: Update title info
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: title_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# $ref: '#/components/schemas/Title'
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Update result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
# user_json:
|
|
||||||
# $ref: '#/components/schemas/User'
|
|
||||||
|
|
||||||
# /titles/{title_id}/reviews:
|
|
||||||
# get:
|
|
||||||
# summary: Get title reviews
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: title_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# - in: query
|
|
||||||
# name: limit
|
|
||||||
# schema:
|
|
||||||
# type: integer
|
|
||||||
# default: 10
|
|
||||||
# - in: query
|
|
||||||
# name: offset
|
|
||||||
# schema:
|
|
||||||
# type: integer
|
|
||||||
# default: 0
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: List of reviews
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: array
|
|
||||||
# items:
|
|
||||||
# $ref: '#/components/schemas/Review'
|
|
||||||
# '204':
|
|
||||||
# description: No reviews found
|
|
||||||
|
|
||||||
/users/{user_id}:
|
/users/{user_id}:
|
||||||
get:
|
get:
|
||||||
summary: Get user info
|
summary: Get user info
|
||||||
|
|
@ -192,99 +141,6 @@ paths:
|
||||||
'500':
|
'500':
|
||||||
description: Unknown server error
|
description: Unknown server error
|
||||||
|
|
||||||
# patch:
|
|
||||||
# summary: Update user
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: user_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# $ref: '#/components/schemas/User'
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Update result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# delete:
|
|
||||||
# summary: Delete user
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: user_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Delete result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# /users:
|
|
||||||
# get:
|
|
||||||
# summary: Search user
|
|
||||||
# parameters:
|
|
||||||
# - in: query
|
|
||||||
# name: query
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# - in: query
|
|
||||||
# name: fields
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: List of users
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: array
|
|
||||||
# items:
|
|
||||||
# $ref: '#/components/schemas/User'
|
|
||||||
|
|
||||||
# post:
|
|
||||||
# summary: Add new user
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# $ref: '#/components/schemas/User'
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Add result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
# user_json:
|
|
||||||
# $ref: '#/components/schemas/User'
|
|
||||||
|
|
||||||
/users/{user_id}/titles/:
|
/users/{user_id}/titles/:
|
||||||
get:
|
get:
|
||||||
summary: Get user titles
|
summary: Get user titles
|
||||||
|
|
@ -348,258 +204,6 @@ paths:
|
||||||
'500':
|
'500':
|
||||||
description: Unknown server error
|
description: Unknown server error
|
||||||
|
|
||||||
# post:
|
|
||||||
# summary: Add user title
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: user_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# title_id:
|
|
||||||
# type: string
|
|
||||||
# status:
|
|
||||||
# type: string
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Add result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# patch:
|
|
||||||
# summary: Update user title
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: user_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# $ref: '#/components/schemas/UserTitle'
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Update result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# delete:
|
|
||||||
# summary: Delete user title
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: user_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# - in: query
|
|
||||||
# name: title_id
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Delete result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# /users/{user_id}/reviews:
|
|
||||||
# get:
|
|
||||||
# summary: Get user reviews
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: user_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# - in: query
|
|
||||||
# name: limit
|
|
||||||
# schema:
|
|
||||||
# type: integer
|
|
||||||
# default: 10
|
|
||||||
# - in: query
|
|
||||||
# name: offset
|
|
||||||
# schema:
|
|
||||||
# type: integer
|
|
||||||
# default: 0
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: List of reviews
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: array
|
|
||||||
# items:
|
|
||||||
# $ref: '#/components/schemas/Review'
|
|
||||||
|
|
||||||
# /reviews:
|
|
||||||
# post:
|
|
||||||
# summary: Add review
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# $ref: '#/components/schemas/Review'
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Add result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# /reviews/{review_id}:
|
|
||||||
# patch:
|
|
||||||
# summary: Update review
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: review_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# requestBody:
|
|
||||||
# required: true
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# $ref: '#/components/schemas/Review'
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Update result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
# delete:
|
|
||||||
# summary: Delete review
|
|
||||||
# parameters:
|
|
||||||
# - in: path
|
|
||||||
# name: review_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Delete result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# /tags:
|
|
||||||
# get:
|
|
||||||
# summary: Get tags
|
|
||||||
# parameters:
|
|
||||||
# - 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
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: List of tags
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: array
|
|
||||||
# items:
|
|
||||||
# $ref: '#/components/schemas/Tag'
|
|
||||||
|
|
||||||
# /media:
|
|
||||||
# post:
|
|
||||||
# summary: Upload image
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Upload result
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
# image_id:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
# get:
|
|
||||||
# summary: Get image path
|
|
||||||
# parameters:
|
|
||||||
# - in: query
|
|
||||||
# name: image_id
|
|
||||||
# required: true
|
|
||||||
# schema:
|
|
||||||
# type: string
|
|
||||||
# responses:
|
|
||||||
# '200':
|
|
||||||
# description: Image path
|
|
||||||
# content:
|
|
||||||
# application/json:
|
|
||||||
# schema:
|
|
||||||
# type: object
|
|
||||||
# properties:
|
|
||||||
# success:
|
|
||||||
# type: boolean
|
|
||||||
# error:
|
|
||||||
# type: string
|
|
||||||
# image_path:
|
|
||||||
# type: string
|
|
||||||
|
|
||||||
components:
|
components:
|
||||||
parameters:
|
parameters:
|
||||||
cursor: # example base64( {id: 1, param: 2019})
|
cursor: # example base64( {id: 1, param: 2019})
|
||||||
|
|
@ -617,6 +221,17 @@ components:
|
||||||
$ref: '#/components/schemas/TitleSort'
|
$ref: '#/components/schemas/TitleSort'
|
||||||
|
|
||||||
schemas:
|
schemas:
|
||||||
|
CursorObj:
|
||||||
|
type: object
|
||||||
|
required:
|
||||||
|
- id
|
||||||
|
properties:
|
||||||
|
id:
|
||||||
|
type: integer
|
||||||
|
format: int64
|
||||||
|
param:
|
||||||
|
type: string
|
||||||
|
|
||||||
TitleSort:
|
TitleSort:
|
||||||
type: string
|
type: string
|
||||||
description: Title sort order
|
description: Title sort order
|
||||||
|
|
@ -778,7 +393,6 @@ components:
|
||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
description: ID of the user avatar (references images table)
|
description: ID of the user avatar (references images table)
|
||||||
nullable: true
|
|
||||||
example: null
|
example: null
|
||||||
mail:
|
mail:
|
||||||
type: string
|
type: string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue