Node.js based forum software built for the modern web
fix(writeapi): fix components, + tag object schema
Julian Lam9f9e3c1582cc
diff --git a/public/openapi/components/schemas/PostObject.yaml b/public/openapi/components/schemas/PostObject.yamlindex 04c7e40937..563d682905 100644--- a/public/openapi/components/schemas/PostObject.yaml+++ b/public/openapi/components/schemas/PostObject.yaml@@ -85,6 +85,22 @@ PostObject:nullable: truetitleRaw:type: string+ oldTitle:+ type: string+ isMainPost:+ type: boolean+ renamed:+ type: true+ tags:+ type: array+ items:+ $ref: ../../components/schemas/TagObject.yaml#/TagObject+ required:+ - uid+ - tid+ - cid+ - title+ - slugcategory:type: objectproperties:diff --git a/public/openapi/components/schemas/TagObject.yaml b/public/openapi/components/schemas/TagObject.yamlnew file mode 100644index 0000000000..2b72c5a1c9--- /dev/null+++ b/public/openapi/components/schemas/TagObject.yaml@@ -0,0 +1,19 @@+TagObject:+ type: object+ properties:+ value:+ type: string+ description: The tag name+ score:+ type: number+ description: The number of topics containing this tag+ valueEscaped:+ type: string+ color:+ type: string+ description: Six-character hexadecimal string (with `#` prepended)+ example: "#ff0000"+ bgColor:+ type: string+ description: Six-character hexadecimal string (with `#` prepended)+ example: "#ff0000"\ No newline at end of filediff --git a/public/openapi/read/admin/manage/tags.yaml b/public/openapi/read/admin/manage/tags.yamlindex d0415b29fb..f42d4df021 100644--- a/public/openapi/read/admin/manage/tags.yaml+++ b/public/openapi/read/admin/manage/tags.yaml@@ -14,22 +14,5 @@ get:tags:type: arrayitems:- type: object- properties:- value:- type: string- description: The tag name- score:- type: number- description: The number of topics containing this tag- valueEscaped:- type: string- color:- type: string- description: Six-character hexadecimal string (with `#` prepended)- example: "#ff0000"- bgColor:- type: string- description: Six-character hexadecimal string (with `#` prepended)- example: "#ff0000"+ $ref: ../../../components/schemas/TagObject.yaml#/TagObject- $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps\ No newline at end of filediff --git a/public/openapi/read/tags.yaml b/public/openapi/read/tags.yamlindex 1627289401..05f407ef18 100644--- a/public/openapi/read/tags.yaml+++ b/public/openapi/read/tags.yaml@@ -16,21 +16,7 @@ get:type: arraydescription: An array of tags sorted by the most topicsitems:- type: object- properties:- value:- type: string- description: The raw tag- score:- type: number- description: Number of topics tagged by this tag- valueEscaped:- type: string- description: This is the escaped tag value, equal to validator.escape(value)- color:- type: string- bgColor:- type: string+ $ref: ../components/schemas/TagObject.yaml#/TagObjectdisplayTagSearch:type: booleannextStart:diff --git a/public/openapi/read/tags/tag.yaml b/public/openapi/read/tags/tag.yamlindex 9a0a79f7a2..cae61daf61 100644--- a/public/openapi/read/tags/tag.yaml+++ b/public/openapi/read/tags/tag.yaml@@ -200,18 +200,7 @@ get:tags:type: arrayitems:- type: object- properties:- value:- type: string- valueEscaped:- type: string- color:- type: string- bgColor:- type: string- score:- type: number+ $ref: ../../components/schemas/TagObject.yaml#/TagObjectisOwner:type: booleanignored:diff --git a/public/openapi/read/topic/topic_id/slug/post_index.yaml b/public/openapi/read/topic/topic_id/slug/post_index.yamlindex d9374eff97..514f3065e5 100644--- a/public/openapi/read/topic/topic_id/slug/post_index.yaml+++ b/public/openapi/read/topic/topic_id/slug/post_index.yaml@@ -89,18 +89,7 @@ get:tags:type: arrayitems:- type: object- properties:- value:- type: string- valueEscaped:- type: string- color:- type: string- bgColor:- type: string- score:- type: number+ $ref: ../../../../components/schemas/TagObject.yaml#/TagObjectposts:type: arrayitems:diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yamlindex f4eb7913bc..c6e8f16cf0 100644--- a/public/openapi/read/unread.yaml+++ b/public/openapi/read/unread.yaml@@ -189,18 +189,7 @@ get:tags:type: arrayitems:- type: object- properties:- value:- type: string- valueEscaped:- type: string- color:- type: string- bgColor:- type: string- score:- type: number+ $ref: ../components/schemas/TagObject.yaml#/TagObjectisOwner:type: booleanignored:diff --git a/public/openapi/write/posts/pid.yaml b/public/openapi/write/posts/pid.yamlindex 28a6bb0bde..2d439bd8f0 100644--- a/public/openapi/write/posts/pid.yaml+++ b/public/openapi/write/posts/pid.yaml@@ -39,7 +39,14 @@ put:status:$ref: ../../components/schemas/Status.yaml#/Statusresponse:- $ref: ../../components/schemas/PostObject.yaml#/PostObject+ allOf:+ - $ref: ../../components/schemas/PostObject.yaml#/PostObject+ - type: object+ properties:+ edited:+ type: boolean+ deleterUid:+ type: numberdelete:tags:- posts