Add /accounts/:username/ratings endpoint (#1756)

* Add /users/me/videos/ratings endpoint

* Move ratings endpoint from users to accounts

* /accounts/:name/ratings: add support for rating= and sort=

* Restrict ratings list to owner

* Wording and better way to ensure current account
This commit is contained in:
Yohan Boniface
2019-04-09 11:02:02 +02:00
committed by Chocobozzz
parent 8ce1ba6e3e
commit c100a6142e
13 changed files with 214 additions and 8 deletions

View File

@@ -1344,6 +1344,35 @@ paths:
type: array
items:
$ref: '#/components/schemas/VideoChannel'
'/accounts/{name}/ratings':
get:
summary: Get ratings of an account by its name
security:
- OAuth2: []
tags:
- User
parameters:
- $ref: '#/components/parameters/start'
- $ref: '#/components/parameters/count'
- $ref: '#/components/parameters/sort'
- name: rating
in: query
required: false
description: Optionaly filter which ratings to retrieve
schema:
type: string
enum:
- like
- dislike
responses:
'200':
description: successful operation
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/VideoRating'
'/videos/{id}/comment-threads':
get:
summary: Get the comment threads of a video by its id
@@ -2142,6 +2171,16 @@ components:
required:
- id
- rating
VideoRating:
properties:
video:
$ref: '#/components/schemas/Video'
rating:
type: number
description: 'Rating of the video'
required:
- video
- rating
RegisterUser:
properties:
username: