Skip to content

Commit

Permalink
fix(writeapi): fix components, + tag object schema
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Oct 28, 2020
1 parent 3ebb3a3 commit 9f9e3c1
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 70 deletions.
16 changes: 16 additions & 0 deletions public/openapi/components/schemas/PostObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions public/openapi/components/schemas/TagObject.yaml
Original file line number Diff line number Diff line change
@@ -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"
19 changes: 1 addition & 18 deletions public/openapi/read/admin/manage/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 1 addition & 15 deletions public/openapi/read/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 1 addition & 12 deletions public/openapi/read/tags/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 1 addition & 12 deletions public/openapi/read/topic/topic_id/slug/post_index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
13 changes: 1 addition & 12 deletions public/openapi/read/unread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion public/openapi/write/posts/pid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9f9e3c1

Please sign in to comment.