2020-12-29 10:31:53 -05:00
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 :
2025-01-07 14:25:13 -05:00
allOf :
- 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
attachments :
type : array
items :
type : string
description : A sha256 hash of the attachment (tied to the corresponding entry in the database)
- type : object
description : Optional properties that may or may not be present (except for `pid`, which is always present, and is only here as a hack to pass validation)
properties :
pid :
type : number
description : A post identifier
sourceContent :
type : string
description : The markdown equivalent of a remote post content, as received (or fetched) from the remote site.
required :
- pid
2020-10-09 11:07:25 -04:00
put :
tags :
- posts
summary : edit a post
description : This operation edits a post
2020-10-24 12:40:52 -04:00
parameters :
- in : path
name : pid
schema :
type : string
required : true
description : a valid post id
example : 1
2020-10-09 11:07:25 -04:00
requestBody :
required : true
content :
application/json :
schema :
type : object
properties :
content :
type : string
description : New post content
2020-10-26 21:51:25 -04:00
example : New post content
2020-10-09 11:07:25 -04:00
title :
type : string
description : Topic title, only accepted for main posts
2020-10-26 21:51:25 -04:00
example : New title
2020-10-09 11:07:25 -04:00
required :
- content
responses :
'200' :
description : Post successfully edited
content :
application/json :
schema :
type : object
properties :
status :
$ref : ../../components/schemas/Status.yaml#/Status
response :
2020-10-27 08:06:00 -04:00
allOf :
- $ref : ../../components/schemas/PostObject.yaml#/PostObject
- type : object
properties :
edited :
type : boolean
deleterUid :
type : number
2020-10-09 11:07:25 -04:00
delete :
tags :
- posts
summary : purge a post
description : This operation purges a post.
2020-10-24 12:40:52 -04:00
parameters :
- in : path
name : pid
schema :
type : string
required : true
description : a valid post id
example : 1
2020-10-09 11:07:25 -04:00
responses :
'200' :
description : Post successfully purged
content :
application/json :
schema :
type : object
properties :
status :
$ref : ../../components/schemas/Status.yaml#/Status
response :
type : object
properties : {}