mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-06 23:00:08 +01:00
chore(spec): replace ugly hack with another hack for optional properties
This commit is contained in:
@@ -1,162 +1,86 @@
|
|||||||
TopicObject:
|
TopicObject:
|
||||||
type: object
|
allOf:
|
||||||
properties:
|
- type: object
|
||||||
tid:
|
|
||||||
type: number
|
|
||||||
description: A topic identifier
|
|
||||||
uid:
|
|
||||||
type: number
|
|
||||||
description: A user identifier
|
|
||||||
cid:
|
|
||||||
type: number
|
|
||||||
description: A category identifier
|
|
||||||
mainPid:
|
|
||||||
type: number
|
|
||||||
description: The post id of the first post in this topic (also called the
|
|
||||||
"original post")
|
|
||||||
title:
|
|
||||||
type: string
|
|
||||||
slug:
|
|
||||||
type: string
|
|
||||||
timestamp:
|
|
||||||
type: number
|
|
||||||
lastposttime:
|
|
||||||
type: number
|
|
||||||
postcount:
|
|
||||||
type: number
|
|
||||||
viewcount:
|
|
||||||
type: number
|
|
||||||
postercount:
|
|
||||||
type: number
|
|
||||||
teaserPid:
|
|
||||||
oneOf:
|
|
||||||
- type: number
|
|
||||||
- type: string
|
|
||||||
nullable: true
|
|
||||||
upvotes:
|
|
||||||
type: number
|
|
||||||
downvotes:
|
|
||||||
type: number
|
|
||||||
deleted:
|
|
||||||
type: number
|
|
||||||
locked:
|
|
||||||
type: number
|
|
||||||
pinned:
|
|
||||||
type: number
|
|
||||||
description: Whether or not this particular topic is pinned to the top of the
|
|
||||||
category
|
|
||||||
deleterUid:
|
|
||||||
type: number
|
|
||||||
titleRaw:
|
|
||||||
type: string
|
|
||||||
timestampISO:
|
|
||||||
type: string
|
|
||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
|
||||||
lastposttimeISO:
|
|
||||||
type: string
|
|
||||||
votes:
|
|
||||||
type: number
|
|
||||||
category:
|
|
||||||
type: object
|
|
||||||
properties:
|
properties:
|
||||||
cid:
|
|
||||||
type: number
|
|
||||||
description: A category identifier
|
|
||||||
name:
|
|
||||||
type: string
|
|
||||||
slug:
|
|
||||||
type: string
|
|
||||||
icon:
|
|
||||||
type: string
|
|
||||||
backgroundImage:
|
|
||||||
nullable: true
|
|
||||||
type: string
|
|
||||||
imageClass:
|
|
||||||
nullable: true
|
|
||||||
type: string
|
|
||||||
bgColor:
|
|
||||||
type: string
|
|
||||||
color:
|
|
||||||
type: string
|
|
||||||
disabled:
|
|
||||||
type: number
|
|
||||||
user:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
uid:
|
|
||||||
type: number
|
|
||||||
description: A user identifier
|
|
||||||
username:
|
|
||||||
type: string
|
|
||||||
description: A friendly name for a given user account
|
|
||||||
displayname:
|
|
||||||
type: string
|
|
||||||
description: This is either username or fullname depending on forum and user settings
|
|
||||||
fullname:
|
|
||||||
type: string
|
|
||||||
userslug:
|
|
||||||
type: string
|
|
||||||
description: An URL-safe variant of the username (i.e. lower-cased, spaces
|
|
||||||
removed, etc.)
|
|
||||||
reputation:
|
|
||||||
type: number
|
|
||||||
postcount:
|
|
||||||
type: number
|
|
||||||
picture:
|
|
||||||
type: string
|
|
||||||
nullable: true
|
|
||||||
signature:
|
|
||||||
type: string
|
|
||||||
nullable: true
|
|
||||||
banned:
|
|
||||||
type: number
|
|
||||||
status:
|
|
||||||
type: string
|
|
||||||
icon:text:
|
|
||||||
type: string
|
|
||||||
description: A single-letter representation of a username. This is used in the
|
|
||||||
auto-generated icon given to users without
|
|
||||||
an avatar
|
|
||||||
icon:bgColor:
|
|
||||||
type: string
|
|
||||||
description: A six-character hexadecimal colour code assigned to the user. This
|
|
||||||
value is used in conjunction with
|
|
||||||
`icon:text` for the user's auto-generated
|
|
||||||
icon
|
|
||||||
example: "#f44336"
|
|
||||||
banned_until_readable:
|
|
||||||
type: string
|
|
||||||
required:
|
|
||||||
- uid
|
|
||||||
- username
|
|
||||||
- userslug
|
|
||||||
- reputation
|
|
||||||
- postcount
|
|
||||||
- picture
|
|
||||||
- signature
|
|
||||||
- banned
|
|
||||||
- status
|
|
||||||
- icon:text
|
|
||||||
- icon:bgColor
|
|
||||||
- banned_until_readable
|
|
||||||
teaser:
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
pid:
|
|
||||||
type: number
|
|
||||||
uid:
|
|
||||||
type: number
|
|
||||||
description: A user identifier
|
|
||||||
timestamp:
|
|
||||||
type: number
|
|
||||||
tid:
|
tid:
|
||||||
type: number
|
type: number
|
||||||
description: A topic identifier
|
description: A topic identifier
|
||||||
content:
|
uid:
|
||||||
|
type: number
|
||||||
|
description: A user identifier
|
||||||
|
cid:
|
||||||
|
type: number
|
||||||
|
description: A category identifier
|
||||||
|
mainPid:
|
||||||
|
type: number
|
||||||
|
description: The post id of the first post in this topic (also called the
|
||||||
|
"original post")
|
||||||
|
title:
|
||||||
|
type: string
|
||||||
|
slug:
|
||||||
|
type: string
|
||||||
|
timestamp:
|
||||||
|
type: number
|
||||||
|
lastposttime:
|
||||||
|
type: number
|
||||||
|
postcount:
|
||||||
|
type: number
|
||||||
|
viewcount:
|
||||||
|
type: number
|
||||||
|
postercount:
|
||||||
|
type: number
|
||||||
|
teaserPid:
|
||||||
|
oneOf:
|
||||||
|
- type: number
|
||||||
|
- type: string
|
||||||
|
nullable: true
|
||||||
|
upvotes:
|
||||||
|
type: number
|
||||||
|
downvotes:
|
||||||
|
type: number
|
||||||
|
deleted:
|
||||||
|
type: number
|
||||||
|
locked:
|
||||||
|
type: number
|
||||||
|
pinned:
|
||||||
|
type: number
|
||||||
|
description: Whether or not this particular topic is pinned to the top of the
|
||||||
|
category
|
||||||
|
deleterUid:
|
||||||
|
type: number
|
||||||
|
titleRaw:
|
||||||
type: string
|
type: string
|
||||||
timestampISO:
|
timestampISO:
|
||||||
type: string
|
type: string
|
||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||||
|
lastposttimeISO:
|
||||||
|
type: string
|
||||||
|
votes:
|
||||||
|
type: number
|
||||||
|
category:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
cid:
|
||||||
|
type: number
|
||||||
|
description: A category identifier
|
||||||
|
name:
|
||||||
|
type: string
|
||||||
|
slug:
|
||||||
|
type: string
|
||||||
|
icon:
|
||||||
|
type: string
|
||||||
|
backgroundImage:
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
imageClass:
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
bgColor:
|
||||||
|
type: string
|
||||||
|
color:
|
||||||
|
type: string
|
||||||
|
disabled:
|
||||||
|
type: number
|
||||||
user:
|
user:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
@@ -166,93 +90,145 @@ TopicObject:
|
|||||||
username:
|
username:
|
||||||
type: string
|
type: string
|
||||||
description: A friendly name for a given user account
|
description: A friendly name for a given user account
|
||||||
|
displayname:
|
||||||
|
type: string
|
||||||
|
description: This is either username or fullname depending on forum and user settings
|
||||||
|
fullname:
|
||||||
|
type: string
|
||||||
userslug:
|
userslug:
|
||||||
type: string
|
type: string
|
||||||
description: An URL-safe variant of the username (i.e. lower-cased, spaces
|
description: An URL-safe variant of the username (i.e. lower-cased, spaces
|
||||||
removed, etc.)
|
removed, etc.)
|
||||||
|
reputation:
|
||||||
|
type: number
|
||||||
|
postcount:
|
||||||
|
type: number
|
||||||
picture:
|
picture:
|
||||||
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
signature:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
banned:
|
||||||
|
type: number
|
||||||
|
status:
|
||||||
type: string
|
type: string
|
||||||
icon:text:
|
icon:text:
|
||||||
type: string
|
type: string
|
||||||
description: A single-letter representation of a username. This is used in the
|
description: A single-letter representation of a username. This is used in the
|
||||||
auto-generated icon given to users
|
auto-generated icon given to users without
|
||||||
without an avatar
|
an avatar
|
||||||
icon:bgColor:
|
icon:bgColor:
|
||||||
type: string
|
type: string
|
||||||
description: A six-character hexadecimal colour code assigned to the user. This
|
description: A six-character hexadecimal colour code assigned to the user. This
|
||||||
value is used in conjunction with
|
value is used in conjunction with
|
||||||
`icon:text` for the user's
|
`icon:text` for the user's auto-generated
|
||||||
auto-generated icon
|
icon
|
||||||
example: "#f44336"
|
example: "#f44336"
|
||||||
|
banned_until_readable:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- uid
|
||||||
|
- username
|
||||||
|
- userslug
|
||||||
|
- reputation
|
||||||
|
- postcount
|
||||||
|
- picture
|
||||||
|
- signature
|
||||||
|
- banned
|
||||||
|
- status
|
||||||
|
- icon:text
|
||||||
|
- icon:bgColor
|
||||||
|
- banned_until_readable
|
||||||
|
teaser:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
pid:
|
||||||
|
type: number
|
||||||
|
uid:
|
||||||
|
type: number
|
||||||
|
description: A user identifier
|
||||||
|
timestamp:
|
||||||
|
type: number
|
||||||
|
tid:
|
||||||
|
type: number
|
||||||
|
description: A topic identifier
|
||||||
|
content:
|
||||||
|
type: string
|
||||||
|
timestampISO:
|
||||||
|
type: string
|
||||||
|
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||||
|
user:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
uid:
|
||||||
|
type: number
|
||||||
|
description: A user identifier
|
||||||
|
username:
|
||||||
|
type: string
|
||||||
|
description: A friendly name for a given user account
|
||||||
|
userslug:
|
||||||
|
type: string
|
||||||
|
description: An URL-safe variant of the username (i.e. lower-cased, spaces
|
||||||
|
removed, etc.)
|
||||||
|
picture:
|
||||||
|
nullable: true
|
||||||
|
type: string
|
||||||
|
icon:text:
|
||||||
|
type: string
|
||||||
|
description: A single-letter representation of a username. This is used in the
|
||||||
|
auto-generated icon given to users
|
||||||
|
without an avatar
|
||||||
|
icon:bgColor:
|
||||||
|
type: string
|
||||||
|
description: A six-character hexadecimal colour code assigned to the user. This
|
||||||
|
value is used in conjunction with
|
||||||
|
`icon:text` for the user's
|
||||||
|
auto-generated icon
|
||||||
|
example: "#f44336"
|
||||||
|
index:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
|
tags:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
valueEscaped:
|
||||||
|
type: string
|
||||||
|
color:
|
||||||
|
type: string
|
||||||
|
bgColor:
|
||||||
|
type: string
|
||||||
|
score:
|
||||||
|
type: number
|
||||||
|
isOwner:
|
||||||
|
type: boolean
|
||||||
|
ignored:
|
||||||
|
type: boolean
|
||||||
|
unread:
|
||||||
|
type: boolean
|
||||||
|
bookmark:
|
||||||
|
nullable: true
|
||||||
|
type: number
|
||||||
|
unreplied:
|
||||||
|
type: boolean
|
||||||
|
icons:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
|
description: HTML injected into the theme
|
||||||
index:
|
index:
|
||||||
type: number
|
type: number
|
||||||
nullable: true
|
- type: object
|
||||||
tags:
|
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)
|
||||||
type: array
|
properties:
|
||||||
items:
|
tid:
|
||||||
type: object
|
type: number
|
||||||
properties:
|
description: A topic identifier
|
||||||
value:
|
thumb:
|
||||||
type: string
|
type: string
|
||||||
valueEscaped:
|
required:
|
||||||
type: string
|
- tid
|
||||||
color:
|
|
||||||
type: string
|
|
||||||
bgColor:
|
|
||||||
type: string
|
|
||||||
score:
|
|
||||||
type: number
|
|
||||||
isOwner:
|
|
||||||
type: boolean
|
|
||||||
ignored:
|
|
||||||
type: boolean
|
|
||||||
unread:
|
|
||||||
type: boolean
|
|
||||||
bookmark:
|
|
||||||
nullable: true
|
|
||||||
type: number
|
|
||||||
unreplied:
|
|
||||||
type: boolean
|
|
||||||
icons:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: string
|
|
||||||
description: HTML injected into the theme
|
|
||||||
index:
|
|
||||||
type: number
|
|
||||||
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
|
type: number
|
||||||
loggedInUser:
|
loggedInUser:
|
||||||
$ref: ../../components/schemas/UserObject.yaml#/UserObject
|
$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/Pagination.yaml#/Pagination
|
||||||
- $ref: ../../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
|
- $ref: ../../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
|
||||||
- $ref: ../../components/schemas/CommonProps.yaml#/CommonProps
|
- $ref: ../../components/schemas/CommonProps.yaml#/CommonProps
|
||||||
Reference in New Issue
Block a user