fix(openapi): added CategoryObject component

This commit is contained in:
Julian Lam
2020-04-08 22:06:22 -04:00
parent 646fac1e53
commit 55d0a9ffea
2 changed files with 323 additions and 546 deletions

View File

@@ -0,0 +1,65 @@
CategoryObject:
type: object
properties:
cid:
type: number
description: A category identifier assigned upon category creation (this value cannot be changed)
name:
type: string
description: The category's name/title
description:
type: string
description: A variable-length description of the category (usually displayed underneath the category name)
descriptionParsed:
type: string
description: A variable-length description of the category (usually displayed underneath the category name). Unlike `description`, this value here will have been run through any parsers installed on the forum (e.g. Markdown)
icon:
type: string
description: A FontAwesome icon string
example: fa-comments-o
bgColor:
type: string
description: Theme-related, a six-character hexadecimal string representing the background colour of the category
color:
type: string
description: Theme-related, a six-character hexadecimal string representing the foreground/text colour of the category
slug:
type: string
description: An URL-safe variant of the category title. This value is automatically generated.
readOnly: true
parentCid:
type: number
description: The category identifier for the category that is the immediate ancestor of the current category
topic_count:
type: number
description: The number of topics in the category
post_count:
type: number
description: The number of posts in the category
disabled:
type: number
description: Whether or not this category is disabled.
order:
type: number
description: A number representing the category's place in the hierarchy
link:
type: string
description: If set, attempting to access the forum will go to this external link instead (theme-specific)
numRecentReplies:
type: number
description: The number of posts to render in the API response (this is mostly used at the theme level)
class:
type: string
description: Values that are appended to the `class` attribute of the category's parent/root element
imageClass:
type: string
enum: [auto, cover, contain]
description: The `background-position` of the category background image, if one is set
isSection:
type: number
totalPostCount:
type: number
description: The number of posts in the category
totalTopicCount:
type: number
description: The number of topics in the category

View File

@@ -61,310 +61,164 @@ paths:
categories: categories:
type: array type: array
items: items:
type: object allOf:
properties: - $ref: components/schemas/CategoryObject.yaml#/CategoryObject
cid: - type: object
type: number properties:
description: A category identifier children:
name: type: array
type: string items:
description: allOf:
type: string - $ref: components/schemas/CategoryObject.yaml#/CategoryObject
icon: - type: object
type: string properties:
slug: tagWhitelist:
type: string type: array
topic_count: items: {}
type: number unread-class:
description: The number of topics in the category type: string
order: children:
type: number type: array
bgColor: items: {}
type: string parent:
link: $ref: components/schemas/CategoryObject.yaml#/CategoryObject
type: string posts:
class: type: array
type: string items:
numRecentReplies: type: object
type: number properties:
color: pid:
type: string type: number
post_count: timestamp:
type: number type: number
description: The number of posts in the category content:
descriptionParsed: type: string
type: string timestampISO:
parentCid: type: string
type: number description: An ISO 8601 formatted date string (complementing `timestamp`)
description: The category identifier for the category that is the immediate user:
ancestor of the current category type: object
disabled: properties:
type: number uid:
isSection: type: number
type: number description: A user identifier
totalPostCount: username:
type: number type: string
description: The number of posts in the category description: A friendly name for a given user account
totalTopicCount: userslug:
type: number type: string
description: The number of topics in the category description: An URL-safe variant of the username (i.e. lower-cased, spaces
tagWhitelist: removed, etc.)
type: array picture:
items: {} nullable: true
unread-class: type: string
type: string icon:text:
children: type: string
type: array description: A single-letter representation of a username. This is used in the
items: auto-generated icon given to
type: object users without an avatar
properties: icon:bgColor:
cid: type: string
type: number description: A six-character hexadecimal colour code assigned to the user. This
description: A category identifier value is used in conjunction
name: with `icon:text` for the user's
type: string auto-generated icon
description: example: "#f44336"
type: string index:
icon: type: number
type: string cid:
slug: type: number
type: string description: A category identifier
topic_count: parentCid:
type: number type: number
description: The number of topics in the category description: The category identifier for the category that is the immediate
order: ancestor of the current category
type: number topic:
bgColor: type: object
type: string properties:
link: slug:
type: string type: string
class: title:
type: string type: string
numRecentReplies: imageClass:
type: number type: string
color: timesClicked:
type: string type: number
post_count: posts:
type: number type: array
description: The number of posts in the category items:
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
disabled:
type: number
isSection:
type: number
totalPostCount:
type: number
description: The number of posts in the category
totalTopicCount:
type: number
description: The number of topics in the category
descriptionParsed:
type: string
tagWhitelist:
type: array
items: {}
unread-class:
type: string
children:
type: array
items: {}
parent:
type: object type: object
properties: properties:
link: pid:
type: string
class:
type: string
icon:
type: string
description:
type: string
order:
type: number type: number
topic_count: timestamp:
type: number type: number
description: The number of topics in the category content:
name:
type: string type: string
timestampISO:
type: string
description: An ISO 8601 formatted date string (complementing `timestamp`)
user:
type: object
properties:
uid:
type: number
description: A user identifier
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
type: string
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users
without an avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with
`icon:text` for the user's
auto-generated icon
example: "#f44336"
index:
type: number
cid: cid:
type: number type: number
description: A category identifier description: A category identifier
post_count:
type: number
description: The number of posts in the category
numRecentReplies:
type: number
bgColor:
type: string
slug:
type: string
color:
type: string
disabled:
type: number
descriptionParsed:
type: string
isSection:
type: number
parentCid: parentCid:
type: number type: number
description: The category identifier for the category that is the immediate description: The category identifier for the category that is the immediate
ancestor of the current category ancestor of the current category
totalPostCount: topic:
type: number type: object
description: The number of posts in the category properties:
totalTopicCount: slug:
type: number type: string
description: The number of topics in the category title:
tagWhitelist: type: string
type: array teaser:
items: {}
unread-class:
type: string
imageClass:
type: string
posts:
type: array
items:
type: object
properties:
pid:
type: number
timestamp:
type: number
content:
type: string
timestampISO:
type: string
description: An ISO 8601 formatted date string (complementing `timestamp`)
user:
type: object
properties:
uid:
type: number
description: A user identifier
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
type: string
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to
users without an avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction
with `icon:text` for the user's
auto-generated icon
example: "#f44336"
index:
type: number
cid:
type: number
description: A category identifier
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
topic:
type: object
properties:
slug:
type: string
title:
type: string
imageClass:
type: string
timesClicked:
type: number
posts:
type: array
items:
type: object
properties:
pid:
type: number
timestamp:
type: number
content:
type: string
timestampISO:
type: string
description: An ISO 8601 formatted date string (complementing `timestamp`)
user:
type: object
properties:
uid:
type: number
description: A user identifier
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
type: string
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users
without an avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with
`icon:text` for the user's
auto-generated icon
example: "#f44336"
index:
type: number
cid:
type: number
description: A category identifier
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
topic:
type: object
properties:
slug:
type: string
title:
type: string
teaser:
type: object
properties:
url:
type: string
timestampISO:
type: string
description: An ISO 8601 formatted date string (complementing `timestamp`)
pid:
type: number
topic:
type: object type: object
properties: properties:
slug: url:
type: string type: string
title: timestampISO:
type: string type: string
imageClass: description: An ISO 8601 formatted date string (complementing `timestamp`)
type: string pid:
type: number
topic:
type: object
properties:
slug:
type: string
title:
type: string
topics: topics:
type: array type: array
items: items:
@@ -3832,6 +3686,7 @@ paths:
application/json: application/json:
schema: schema:
allOf: allOf:
- $ref: components/schemas/CategoryObject.yaml#/CategoryObject
- type: object - type: object
properties: properties:
tid: tid:
@@ -4041,54 +3896,6 @@ paths:
type: boolean type: boolean
display_post_menu: display_post_menu:
type: boolean type: boolean
category:
type: object
properties:
link:
type: string
class:
type: string
icon:
type: string
description:
type: string
order:
type: number
topic_count:
type: number
description: The number of topics in the category
name:
type: string
cid:
type: number
description: A category identifier
post_count:
type: number
description: The number of posts in the category
numRecentReplies:
type: number
bgColor:
type: string
slug:
type: string
color:
type: string
disabled:
type: number
descriptionParsed:
type: string
isSection:
type: number
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
totalPostCount:
type: number
description: The number of posts in the category
totalTopicCount:
type: number
description: The number of topics in the category
tagWhitelist: tagWhitelist:
type: array type: array
items: {} items: {}
@@ -4226,6 +4033,7 @@ paths:
application/json: application/json:
schema: schema:
allOf: allOf:
- $ref: components/schemas/CategoryObject.yaml#/CategoryObject
- type: object - type: object
properties: properties:
tid: tid:
@@ -4491,54 +4299,6 @@ paths:
username: username:
type: string type: string
description: A friendly name for a given user account description: A friendly name for a given user account
category:
type: object
properties:
link:
type: string
class:
type: string
icon:
type: string
description:
type: string
order:
type: number
topic_count:
type: number
description: The number of topics in the category
name:
type: string
cid:
type: number
description: A category identifier
post_count:
type: number
description: The number of posts in the category
numRecentReplies:
type: number
bgColor:
type: string
slug:
type: string
color:
type: string
disabled:
type: number
descriptionParsed:
type: string
isSection:
type: number
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
totalPostCount:
type: number
description: The number of posts in the category
totalTopicCount:
type: number
description: The number of topics in the category
tagWhitelist: tagWhitelist:
type: array type: array
items: {} items: {}
@@ -4988,186 +4748,138 @@ paths:
posts: posts:
type: array type: array
items: items:
type: object allOf:
properties: - type: object
id:
type: string
uid:
type: number
description: A user identifier
type:
type: string
data:
type: object
properties: properties:
title: id:
type: string type: string
content:
type: string
thumb:
type: string
cid:
oneOf:
- type: number
- type: string
tags:
type: array
items: {}
uid: uid:
type: number type: number
description: A user identifier description: A user identifier
req: type:
type: string
data:
type: object type: object
properties: properties:
title:
type: string
content:
type: string
thumb:
type: string
cid:
oneOf:
- type: number
- type: string
tags:
type: array
items: {}
uid: uid:
type: number type: number
description: A user identifier description: A user identifier
ip: req:
type: string
host:
type: string
protocol:
type: string
secure:
type: boolean
url:
type: string
path:
type: string
headers:
type: object type: object
properties: properties:
x-real-ip: uid:
type: string type: number
x-forwarded-for: description: A user identifier
type: string ip:
x-forwarded-proto:
type: string type: string
host: host:
type: string type: string
x-nginx-proxy: protocol:
type: string type: string
connection: secure:
type: boolean
url:
type: string type: string
accept: path:
type: string type: string
user-agent: headers:
type: string type: object
sec-fetch-site: properties:
type: string x-real-ip:
sec-fetch-mode: type: string
type: string x-forwarded-for:
referer: type: string
type: string x-forwarded-proto:
accept-encoding: type: string
type: string host:
accept-language: type: string
type: string x-nginx-proxy:
cookie: type: string
type: string connection:
timestamp: type: string
type: number accept:
fromQueue: type: string
type: boolean user-agent:
timestampISO: type: string
type: string sec-fetch-site:
description: An ISO 8601 formatted date string (complementing `timestamp`) type: string
rawContent: sec-fetch-mode:
type: string type: string
tid: referer:
type: number type: string
description: A topic identifier accept-encoding:
toPid: type: string
nullable: true accept-language:
user: type: string
type: object cookie:
properties: type: string
username: timestamp:
type: string type: number
description: A friendly name for a given user account fromQueue:
userslug: type: boolean
type: string timestampISO:
description: An URL-safe variant of the username (i.e. lower-cased, spaces type: string
removed, etc.) description: An ISO 8601 formatted date string (complementing `timestamp`)
picture: rawContent:
nullable: true type: string
type: string tid:
uid: type: number
type: number description: A topic identifier
description: A user identifier toPid:
icon:text: nullable: true
type: string user:
description: A single-letter representation of a username. This is used in the type: object
auto-generated icon given to users without properties:
an avatar username:
icon:bgColor: type: string
type: string description: A friendly name for a given user account
description: A six-character hexadecimal colour code assigned to the user. This userslug:
value is used in conjunction with type: string
`icon:text` for the user's auto-generated description: An URL-safe variant of the username (i.e. lower-cased, spaces
icon removed, etc.)
example: "#f44336" picture:
topic: nullable: true
type: object type: string
properties: uid:
cid: type: number
oneOf: description: A user identifier
- type: number icon:text:
- type: string type: string
title: description: A single-letter representation of a username. This is used in the
type: string auto-generated icon given to users without
titleRaw: an avatar
type: string icon:bgColor:
category: type: string
type: object description: A six-character hexadecimal colour code assigned to the user. This
properties: value is used in conjunction with
cid: `icon:text` for the user's auto-generated
type: number icon
description: A category identifier example: "#f44336"
name: topic:
type: string type: object
description: properties:
type: string cid:
icon: oneOf:
type: string - type: number
bgColor: - type: string
type: string title:
color: type: string
type: string titleRaw:
slug: type: string
type: string - $ref: components/schemas/CategoryObject.yaml#/CategoryObject
parentCid:
type: number
description: The category identifier for the category that is the immediate
ancestor of the current category
topic_count:
type: number
description: The number of topics in the category
post_count:
type: number
description: The number of posts in the category
disabled:
type: number
order:
type: number
link:
type: string
numRecentReplies:
type: number
class:
type: string
imageClass:
type: string
descriptionParsed:
type: string
isSection:
type: number
totalPostCount:
type: number
description: The number of posts in the category
totalTopicCount:
type: number
description: The number of topics in the category
- $ref: components/schemas/Pagination.yaml#/Pagination - $ref: components/schemas/Pagination.yaml#/Pagination
- $ref: components/schemas/CommonProps.yaml#/CommonProps - $ref: components/schemas/CommonProps.yaml#/CommonProps
/api/ip-blacklist: /api/ip-blacklist: