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

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

@ -85,6 +85,22 @@ PostObject:
nullable: true
titleRaw:
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:
type: object
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:
type: array
items:
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

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

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

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

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

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

Loading…
Cancel
Save