chore(spec): replace ugly hack with another hack for optional properties

v1.18.x
Julian Lam 4 years ago
parent f20c12ee40
commit 45a4f1361f

@ -1,5 +1,6 @@
TopicObject:
type: object
allOf:
- type: object
properties:
tid:
type: number
@ -221,38 +222,13 @@ TopicObject:
description: HTML injected into the theme
index:
type: number
- type: object
description: Optional properties that may or may not be present (except for `tid`, which is always present, and is only here as a hack to pass validation)
properties:
tid:
type: number
description: A topic identifier
thumb:
type: string
required:
- tid
- uid
- cid
- mainPid
- title
- slug
- timestamp
- lastposttime
- postcount
- viewcount
- teaserPid
- upvotes
- downvotes
- deleted
- locked
- pinned
- deleterUid
- titleRaw
- timestampISO
- lastposttimeISO
- votes
- category
- user
- teaser
- tags
- isOwner
- ignored
- unread
- bookmark
- unreplied
- icons
- index

@ -403,6 +403,17 @@ get:
type: number
loggedInUser:
$ref: ../../components/schemas/UserObject.yaml#/UserObject
- type: object
description: Optional properties that may or may not be present (except for `tid`, which is always present, and is only here as a hack to pass validation)
properties:
tid:
type: number
description: A topic identifier
thumb:
type: string
description: An uploaded topic thumbnail
required:
- tid
- $ref: ../../components/schemas/Pagination.yaml#/Pagination
- $ref: ../../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
- $ref: ../../components/schemas/CommonProps.yaml#/CommonProps
Loading…
Cancel
Save