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.

141 lines
3.8 KiB
YAML

get:
tags:
- posts
summary: get a post
description: This operation retrieves a post's data
parameters:
- in: path
name: pid
schema:
type: string
required: true
description: a valid post id
example: 1
responses:
'200':
description: Post successfully retrieved
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../components/schemas/Status.yaml#/Status
response:
type: object
properties:
pid:
type: number
uid:
type: number
description: A user identifier
tid:
type: number
description: A topic identifier
content:
type: string
timestamp:
type: number
flagId:
type: number
deleted:
type: number
upvotes:
type: number
downvotes:
type: number
deleterUid:
type: number
edited:
type: number
replies:
type: number
bookmarks:
type: number
votes:
type: number
timestampISO:
type: string
description: An ISO 8601 formatted date string (complementing `timestamp`)
editedISO:
type: string
description: An ISO 8601 formatted date string (complementing `timestamp`)
upvoted:
type: boolean
downvoted:
type: boolean
put:
tags:
- posts
summary: edit a post
description: This operation edits a post
parameters:
- in: path
name: pid
schema:
type: string
required: true
description: a valid post id
example: 1
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
content:
type: string
description: New post content
example: New post content
title:
type: string
description: Topic title, only accepted for main posts
example: New title
required:
- content
responses:
'200':
description: Post successfully edited
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../components/schemas/Status.yaml#/Status
response:
allOf:
- $ref: ../../components/schemas/PostObject.yaml#/PostObject
- type: object
properties:
edited:
type: boolean
deleterUid:
type: number
delete:
tags:
- posts
summary: purge a post
description: This operation purges a post.
parameters:
- in: path
name: pid
schema:
type: string
required: true
description: a valid post id
example: 1
responses:
'200':
description: Post successfully purged
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../components/schemas/Status.yaml#/Status
response:
type: object
properties: {}