fix(writeapi): fix components, + tag object schema

v1.18.x
Julian Lam 5 years ago
parent 3ebb3a3479
commit 9f9e3c1582

@ -85,6 +85,22 @@ PostObject:
nullable: true nullable: true
titleRaw: titleRaw:
type: string 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
- slug
category: category:
type: object type: object
properties: properties:

@ -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"

@ -14,22 +14,5 @@ get:
tags: tags:
type: array type: array
items: items:
type: object $ref: ../../../components/schemas/TagObject.yaml#/TagObject
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/CommonProps.yaml#/CommonProps - $ref: ../../../components/schemas/CommonProps.yaml#/CommonProps

@ -16,21 +16,7 @@ get:
type: array type: array
description: An array of tags sorted by the most topics description: An array of tags sorted by the most topics
items: items:
type: object $ref: ../components/schemas/TagObject.yaml#/TagObject
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
displayTagSearch: displayTagSearch:
type: boolean type: boolean
nextStart: nextStart:

@ -200,18 +200,7 @@ get:
tags: tags:
type: array type: array
items: items:
type: object $ref: ../../components/schemas/TagObject.yaml#/TagObject
properties:
value:
type: string
valueEscaped:
type: string
color:
type: string
bgColor:
type: string
score:
type: number
isOwner: isOwner:
type: boolean type: boolean
ignored: ignored:

@ -89,18 +89,7 @@ get:
tags: tags:
type: array type: array
items: items:
type: object $ref: ../../../../components/schemas/TagObject.yaml#/TagObject
properties:
value:
type: string
valueEscaped:
type: string
color:
type: string
bgColor:
type: string
score:
type: number
posts: posts:
type: array type: array
items: items:

@ -189,18 +189,7 @@ get:
tags: tags:
type: array type: array
items: items:
type: object $ref: ../components/schemas/TagObject.yaml#/TagObject
properties:
value:
type: string
valueEscaped:
type: string
color:
type: string
bgColor:
type: string
score:
type: number
isOwner: isOwner:
type: boolean type: boolean
ignored: ignored:

@ -39,7 +39,14 @@ put:
status: status:
$ref: ../../components/schemas/Status.yaml#/Status $ref: ../../components/schemas/Status.yaml#/Status
response: response:
$ref: ../../components/schemas/PostObject.yaml#/PostObject allOf:
- $ref: ../../components/schemas/PostObject.yaml#/PostObject
- type: object
properties:
edited:
type: boolean
deleterUid:
type: number
delete: delete:
tags: tags:
- posts - posts

Loading…
Cancel
Save