Node.js based forum software built for the modern web
feat: common schema
Barış Soner Uşaklıeade13f92865
diff --git a/public/openapi/read.yaml b/public/openapi/read.yamlindex eb798b08d7..757e673aa4 100644--- a/public/openapi/read.yaml+++ b/public/openapi/read.yaml@@ -37,6 +37,73 @@ tags:description: Disparate method of categorizing topics- name: shorthanddescription: Convenience and utility routes for accessing other part of the API+components:+ schemas:+ CommonProps:+ type: object+ properties:+ loggedIn:+ type: boolean+ relative_path:+ type: string+ url:+ type: string+ bodyClass:+ type: string+ _header:+ type: object+ properties:+ tags:+ type: object+ properties:+ meta:+ type: array+ items:+ type: object+ properties:+ name:+ type: string+ content:+ type: string+ noEscape:+ type: boolean+ property:+ type: string+ required:+ - name+ - content+ - noEscape+ - property+ link:+ type: array+ items:+ type: object+ properties:+ rel:+ type: string+ type:+ type: string+ href:+ type: string+ title:+ type: string+ sizes:+ type: string+ required:+ - rel+ - href+ - type+ - sizes+ widgets:+ type: object+ properties:+ footer:+ type: array+ items:+ type: object+ properties:+ html:+ type: stringpaths:/api/:get:@@ -51,449 +118,381 @@ paths:content:application/json:schema:- type: object- properties:- title:- type: string- categories:- type: array- items:- type: object- properties:- cid:- type: number- description: A category identifier- name:- type: string- description:- type: string- icon:- type: string- slug:- type: string- topic_count:- type: number- description: The number of topics in the category- order:- type: number- bgColor:- type: string- link:- type: string- class:- type: string- numRecentReplies:- type: number- color:- type: string- post_count:- type: number- description: The number of posts in the category- descriptionParsed:- type: string- 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- tagWhitelist:- type: array- items: {}- unread-class:- type: string- children:- type: array- items:- type: object- properties:- cid:- type: number- description: A category identifier- name:- type: string- description:- type: string- icon:- type: string- slug:- type: string- topic_count:- type: number- description: The number of topics in the category- order:- type: number- bgColor:- type: string- link:- type: string- class:- type: string- numRecentReplies:- type: number- color:- type: string- post_count:- type: number- description: The number of posts in the category- 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:+ allOf:+ - $ref: '#/components/schemas/CommonProps'+ - type: object+ properties:+ title:+ type: string+ categories:+ type: array+ items:+ type: object+ properties:+ cid:+ type: number+ description: A category identifier+ name:+ type: string+ description:+ type: string+ icon:+ type: string+ slug:+ type: string+ topic_count:+ type: number+ description: The number of topics in the category+ order:+ type: number+ bgColor:+ type: string+ link:+ type: string+ class:+ type: string+ numRecentReplies:+ type: number+ color:+ type: string+ post_count:+ type: number+ description: The number of posts in the category+ descriptionParsed:+ type: string+ 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+ tagWhitelist:+ type: array+ items: {}+ unread-class:+ type: string+ children:+ type: array+ items:type: objectproperties:- link:+ cid:+ type: number+ description: A category identifier+ name:type: string- class:+ description:type: stringicon:type: string- description:+ slug:type: string- order:- type: numbertopic_count:type: numberdescription: 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:+ order:type: numberbgColor:type: string- slug:+ link:type: string- color:+ class:type: string- disabled:+ numRecentReplies:type: number- descriptionParsed:+ color:type: string- isSection:+ post_count:type: number+ description: The number of posts in the categoryparentCid:type: numberdescription: The category identifier for the category that is the immediate ancestor of the current category+ disabled:+ type: number+ isSection:+ type: numbertotalPostCount:type: numberdescription: The number of posts in the categorytotalTopicCount:type: numberdescription: The number of topics in the category+ descriptionParsed:+ type: stringtagWhitelist:type: arrayitems: {}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:+ children:+ type: array+ items: {}+ parent:+ 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:+ type: array+ items: {}+ unread-class:+ type: string+ imageClass:+ type: string+ posts:+ type: array+ items:type: objectproperties:- uid:+ pid: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:+ timestamp:+ type: number+ content:type: string- title:+ timestampISO: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- properties:- slug:- type: string- title:- type: string- imageClass:- type: string- loggedIn:- type: boolean- relative_path:- type: string- template:- type: object- properties:- name:- type: string- categories:- type: boolean- url:- type: string- bodyClass:- type: string- topics:- type: array- items:- type: object- properties:- tid:- type: number- description: A topic identifier- uid:- type: number- description: A user identifier- cid:- type: number- description: A category identifier- mainPid:- type: number- description: The post id of the first post in this topic (also called the "original post")- 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- description: Whether or not this particular topic is pinned to the top of the category- upvotes:- type: number- downvotes:- type: number- titleRaw:- type: string- timestampISO:- type: string- description: An ISO 8601 formatted date string (complementing `timestamp`)- lastposttimeISO:- type: string- votes:- type: number- category:- type: object- properties:- cid:- type: number- description: A category identifier- name:- type: string- slug:- type: string- icon:- type: string- image:- nullable: true+ 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+ properties:+ slug:+ type: string+ title:+ type: stringimageClass:- nullable: true- type: string- bgColor:type: string- color:- type: string- disabled:- type: number- user:+ template:+ type: object+ properties:+ name:+ type: string+ categories:+ type: boolean+ topics:+ type: array+ items:type: objectproperties:+ tid:+ type: number+ description: A topic identifieruid:type: numberdescription: A user identifier- username:+ cid:+ type: number+ description: A category identifier+ mainPid:+ type: number+ description: The post id of the first post in this topic (also called the "original post")+ title:type: string- description: A friendly name for a given user account- userslug:+ slug:type: string- description: An URL-safe variant of the username (i.e. lower-cased, spaces removed, etc.)- reputation:+ timestamp:+ type: number+ lastposttime:type: numberpostcount:type: number- picture:- nullable: true- type: string- signature:- nullable: true- type: string- banned:+ viewcount:type: number- status:- 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"- banned_until_readable:- type: string- oldUid:+ deleted:type: number- groupTitle:- type: string- groupTitleArray:- type: array- items: {}- fullname:- type: string- teaser:- type: object- properties:- pid:+ locked:type: number- uid:+ pinned:type: number- description: A user identifier- timestamp:+ description: Whether or not this particular topic is pinned to the top of the category+ upvotes:type: number- tid:+ downvotes:type: number- description: A topic identifier- content:+ titleRaw:type: stringtimestampISO:type: stringdescription: An ISO 8601 formatted date string (complementing `timestamp`)+ lastposttimeISO:+ type: string+ votes:+ type: number+ category:+ type: object+ properties:+ cid:+ type: number+ description: A category identifier+ name:+ type: string+ slug:+ type: string+ icon:+ type: string+ image:+ nullable: true+ imageClass:+ nullable: true+ type: string+ bgColor:+ type: string+ color:+ type: string+ disabled:+ type: numberuser:type: objectproperties:@@ -506,9 +505,20 @@ paths:userslug:type: stringdescription: An URL-safe variant of the username (i.e. lower-cased, spaces removed, etc.)+ reputation:+ type: number+ postcount:+ type: numberpicture:nullable: truetype: string+ signature:+ nullable: true+ type: string+ banned:+ type: number+ status:+ type: stringicon:text:type: stringdescription: A single-letter representation of a username. This is used in the auto-generated icon given to users without an avatar@@ -516,107 +526,93 @@ paths:type: stringdescription: 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 iconexample: "#f44336"- index:- type: number- tags:- type: array- items:- type: object- properties:- value:- type: string- valueEscaped:- type: string- color:- type: string- bgColor:- type: string- score:- type: number- isOwner:- type: boolean- ignored:- type: boolean- unread:- type: boolean- bookmark:- nullable: true- unreplied:- type: boolean- icons:- type: array- items: {}- index:- type: number- thumb:- type: string- teaserPid:- type: number- _header:- type: object- properties:- tags:- type: object- properties:- meta:- type: array- items:- type: object- properties:- name:+ banned_until_readable:type: string- content:+ oldUid:+ type: number+ groupTitle:type: string- noEscape:- type: boolean- property:+ groupTitleArray:+ type: array+ items: {}+ fullname:type: string- link:- type: array- items:+ teaser:type: objectproperties:- rel:- type: string- type:- type: string- href:- type: string- title:+ pid:+ type: number+ uid:+ type: number+ description: A user identifier+ timestamp:+ type: number+ tid:+ type: number+ description: A topic identifier+ content:type: string- sizes:+ timestampISO:type: string- widgets:- type: object- properties:- sidebar:- type: array- items:- type: object- properties:- html:- type: string- header:- type: array- items:- type: object- properties:- html:- type: string- footer:- type: array- items:- type: object- properties:- html:- type: string- motd:- type: array- items:- type: object- properties:- html:+ 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+ tags:+ type: array+ items:+ type: object+ properties:+ value:+ type: string+ valueEscaped:+ type: string+ color:+ type: string+ bgColor:+ type: string+ score:+ type: number+ isOwner:+ type: boolean+ ignored:+ type: boolean+ unread:+ type: boolean+ bookmark:+ nullable: true+ unreplied:+ type: boolean+ icons:+ type: array+ items: {}+ index:+ type: number+ thumb:type: string+ teaserPid:+ type: number"304":description: """/api/post/{pid}/raw":