You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.5 KiB
YAML

put:
tags:
- posts
summary: vote on a post
description: This operation casts a vote on a post.
parameters:
- in: path
name: pid
schema:
type: string
required: true
description: a valid post id
example: 2
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
delta:
type: number
description: Positive integer for upvote, negative integer for downvote (0 to unvote.)
example: 1
responses:
'200':
description: Post successfully upvoted
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties: {}
delete:
tags:
- posts
summary: unvote a post
description: This operation removes a pre-cast vote on a post.
parameters:
- in: path
name: pid
schema:
type: string
required: true
description: a valid post id
example: 2
responses:
'200':
description: Post successfully unvoted
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties: {}