fix(openapi): more fleshing out

v1.18.x
Julian Lam 5 years ago
parent bae88e089a
commit 058a15dbb2

@ -3440,7 +3440,7 @@ paths:
get: get:
tags: tags:
- users - users
summary: /api/user/uid/{userslug}/export/posts summary: Export a user's posts (.csv)
parameters: parameters:
- name: userslug - name: userslug
in: path in: path
@ -3448,8 +3448,13 @@ paths:
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A CSV file containing a user's posts"
content:
text/csv:
schema:
type: string
format: binary
"/api/user/uid/{userslug}/export/uploads": "/api/user/uid/{userslug}/export/uploads":
get: get:
tags: tags:
@ -3481,65 +3486,180 @@ paths:
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A CSV file containing the user profile"
"/api/{type}/pid/{id}": content:
text/csv:
schema:
type: string
format: binary
"/api/post/pid/{id}":
get: get:
tags: tags:
- shorthand - shorthand
summary: /api/{type}/pid/{id} summary: Get post data
parameters: parameters:
- name: type
in: path
required: true
schema:
type: string
- name: id - name: id
in: path in: path
required: true required: true
schema: schema:
type: string type: number
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A JSON object containing post data"
"/api/{type}/tid/{id}": content:
application/json:
schema:
type: object
properties:
uid:
type: number
tid:
type: number
timestamp:
type: number
content:
type: string
pid:
type: number
downvotes:
type: number
upvotes:
type: number
deleted:
type: number
deleterUid:
type: number
edited:
type: number
votes:
type: number
timestampISO:
type: string
editedISO:
type: string
upvoted:
type: boolean
downvoted:
type: boolean
"/api/topic/tid/{id}":
get: get:
tags: tags:
- shorthand - shorthand
summary: /api/{type}/tid/{id} summary: Get topic data
parameters: parameters:
- name: type
in: path
required: true
schema:
type: string
- name: id - name: id
in: path in: path
required: true required: true
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A JSON object containing topic data"
"/api/{type}/cid/{id}": content:
application/json:
schema:
type: object
properties:
tid:
type: number
uid:
type: number
cid:
type: number
mainPid:
type: number
title:
type: string
slug:
type: string
timestamp:
type: number
lastposttime:
type: number
postcount:
type: number
viewcount:
type: number
deleted:
type: number
locked:
type: number
pinned:
type: number
upvotes:
type: number
downvotes:
type: number
deleterUid:
type: number
titleRaw:
type: string
timestampISO:
type: string
lastposttimeISO:
type: string
votes:
type: number
"/api/category/cid/{id}":
get: get:
tags: tags:
- shorthand - shorthand
summary: /api/{type}/cid/{id} summary: Get category data
parameters: parameters:
- name: type
in: path
required: true
schema:
type: string
- name: id - name: id
in: path in: path
required: true required: true
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A JSON object containing topic data"
content:
application/json:
schema:
type: object
properties:
cid:
type: number
name:
type: number
description:
type: string
descriptionParsed:
type: string
icon:
type: string
bgColor:
type: string
color:
type: string
slug:
type: string
parentCid:
type: number
topic_count:
type: number
post_count:
type: number
disabled:
type: number
order:
type: number
link:
type: string
numRecentReplies:
type: number
class:
type: string
imageClass:
type: string
isSection:
type: number
totalPostCount:
type: number
totalTopicCount:
type: number
/api/categories: /api/categories:
get: get:
tags: tags:
@ -3999,15 +4119,19 @@ paths:
get: get:
tags: tags:
- posts - posts
summary: /api/unread/total summary: Get number of unread topics
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "Success"
content:
text/plain:
schema:
type: number
"/api/topic/teaser/{topic_id}": "/api/topic/teaser/{topic_id}":
get: get:
tags: tags:
- topics - topics
summary: /api/topic/teaser/{topic_id} summary: Get a topic's teaser post
parameters: parameters:
- name: topic_id - name: topic_id
in: path in: path
@ -4015,8 +4139,12 @@ paths:
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A JSON object containing the teaser post for a topic"
content:
application/json:
schema:
$ref: components/schemas/PostsObject.yaml#/PostsObject
"/api/topic/pagination/{topic_id}": "/api/topic/pagination/{topic_id}":
get: get:
tags: tags:
@ -4159,10 +4287,38 @@ paths:
post: post:
tags: tags:
- topics - topics
summary: /api/topic/thumb/upload summary: Upload topic thumb
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
files:
type: array
items:
type: string
format: binary
required:
- files
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "Image uploaded"
content:
application/json:
schema:
type: object
properties:
name:
type: string
description: The filename
url:
type: string
description: URL of the uploaded image for use client-side
path:
type: string
description: Path to the file in the local file system
"/api/user/{userslug}/uploadpicture": "/api/user/{userslug}/uploadpicture":
post: post:
tags: tags:
@ -4394,20 +4550,54 @@ paths:
- $ref: components/schemas/Pagination.yaml#/Pagination - $ref: components/schemas/Pagination.yaml#/Pagination
- $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs - $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: components/schemas/CommonProps.yaml#/CommonProps - $ref: components/schemas/CommonProps.yaml#/CommonProps
"/api/reset/{code?}": "/api/reset":
get:
tags:
- authentication
summary: Get user password reset (step 1)
responses:
"200":
description: "A JSON object containing the 1st step of the user password reset flow"
content:
application/json:
schema:
allOf:
- type: object
properties:
code:
type: string
- $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: components/schemas/CommonProps.yaml#/CommonProps
"/api/reset/{code}":
get: get:
tags: tags:
- authentication - authentication
summary: /api/reset/{code?} summary: Get user password reset (step 2)
parameters: parameters:
- name: code? - name: code
in: path in: path
required: true required: true
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "A JSON object containing the 2nd step of the user password reset flow"
content:
application/json:
schema:
allOf:
- type: object
properties:
valid:
type: boolean
code:
type: string
minimumPasswordLength:
type: number
minimumPasswordStrength:
type: number
- $ref: components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: components/schemas/CommonProps.yaml#/CommonProps
"/api/email/unsubscribe/{token}": "/api/email/unsubscribe/{token}":
get: get:
tags: tags:
@ -4420,8 +4610,10 @@ paths:
schema: schema:
type: string type: string
responses: responses:
"418": "200":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "Successfully unsubscribed"
"500":
description: "Server-side error (likely token verification failure)"
"/api/topic/{topic_id}/{slug}/{post_index?}": "/api/topic/{topic_id}/{slug}/{post_index?}":
get: get:
tags: tags:
@ -5636,7 +5828,7 @@ paths:
summary: /api/ip-blacklist summary: /api/ip-blacklist
responses: responses:
"418": "418":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "TODO: A proper response needs to be added. It is not really a teapot | Copy response from corresponding admin route"
/api/registration-queue: /api/registration-queue:
get: get:
tags: tags:
@ -5644,7 +5836,7 @@ paths:
summary: /api/registration-queue summary: /api/registration-queue
responses: responses:
"418": "418":
description: "TODO: A proper response needs to be added. It is not really a teapot" description: "TODO: A proper response needs to be added. It is not really a teapot | Copy response from corresponding admin route"
"/api/tags/{tag}": "/api/tags/{tag}":
get: get:
tags: tags:

Loading…
Cancel
Save