mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: add TopicObjectSlim common schema
This commit is contained in:
@@ -13,8 +13,7 @@ TopicObject:
|
|||||||
description: A category identifier
|
description: A category identifier
|
||||||
mainPid:
|
mainPid:
|
||||||
type: number
|
type: number
|
||||||
description: The post id of the first post in this topic (also called the
|
description: The post id of the first post in this topic (also called the "original post")
|
||||||
"original post")
|
|
||||||
title:
|
title:
|
||||||
type: string
|
type: string
|
||||||
slug:
|
slug:
|
||||||
@@ -55,6 +54,7 @@ TopicObject:
|
|||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||||
lastposttimeISO:
|
lastposttimeISO:
|
||||||
type: string
|
type: string
|
||||||
|
description: An ISO 8601 formatted date string (complementing `lastposttime`)
|
||||||
votes:
|
votes:
|
||||||
type: number
|
type: number
|
||||||
category:
|
category:
|
||||||
@@ -230,5 +230,65 @@ TopicObject:
|
|||||||
description: A topic identifier
|
description: A topic identifier
|
||||||
thumb:
|
thumb:
|
||||||
type: string
|
type: string
|
||||||
|
pinExpiry:
|
||||||
|
type: number
|
||||||
|
description: A UNIX timestamp indicating when a pinned topic will no longer be pinned (i.e. the pin has expired)
|
||||||
|
pinExpiryISO:
|
||||||
|
type: string
|
||||||
|
description: "`pinExpiry` rendered as an ISO 8601 format"
|
||||||
required:
|
required:
|
||||||
- tid
|
- tid
|
||||||
|
TopicObjectSlim:
|
||||||
|
description: The output of a call to `Topics.getTopicField`, these properties are always present no matter the fields passed in
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
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")
|
||||||
|
postcount:
|
||||||
|
type: number
|
||||||
|
viewcount:
|
||||||
|
type: number
|
||||||
|
postercount:
|
||||||
|
type: number
|
||||||
|
deleted:
|
||||||
|
type: number
|
||||||
|
deleterUid:
|
||||||
|
type: number
|
||||||
|
locked:
|
||||||
|
type: number
|
||||||
|
pinned:
|
||||||
|
type: number
|
||||||
|
description: Whether or not this particular topic is pinned to the top of the
|
||||||
|
category
|
||||||
|
timestamp:
|
||||||
|
type: number
|
||||||
|
timestampISO:
|
||||||
|
type: string
|
||||||
|
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||||
|
lastposttime:
|
||||||
|
type: number
|
||||||
|
lastposttimeISO:
|
||||||
|
type: string
|
||||||
|
description: An ISO 8601 formatted date string (complementing `lastposttime`)
|
||||||
|
pinExpiry:
|
||||||
|
type: number
|
||||||
|
description: A UNIX timestamp indicating when a pinned topic will no longer be pinned (i.e. the pin has expired)
|
||||||
|
pinExpiryISO:
|
||||||
|
type: string
|
||||||
|
description: "`pinExpiry` rendered as an ISO 8601 format"
|
||||||
|
upvotes:
|
||||||
|
type: number
|
||||||
|
downvotes:
|
||||||
|
type: number
|
||||||
|
votes:
|
||||||
|
type: number
|
||||||
@@ -15,16 +15,10 @@ get:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
allOf:
|
||||||
|
- $ref: ../../../components/schemas/TopicObject.yaml#/TopicObjectSlim
|
||||||
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
tid:
|
|
||||||
type: number
|
|
||||||
uid:
|
|
||||||
type: number
|
|
||||||
cid:
|
|
||||||
type: number
|
|
||||||
mainPid:
|
|
||||||
type: number
|
|
||||||
teaserPid:
|
teaserPid:
|
||||||
type: number
|
type: number
|
||||||
nullable: true
|
nullable: true
|
||||||
@@ -32,33 +26,5 @@ get:
|
|||||||
type: string
|
type: string
|
||||||
slug:
|
slug:
|
||||||
type: string
|
type: string
|
||||||
timestamp:
|
|
||||||
type: number
|
|
||||||
lastposttime:
|
|
||||||
type: number
|
|
||||||
postercount:
|
|
||||||
type: number
|
|
||||||
postcount:
|
|
||||||
type: number
|
|
||||||
viewcount:
|
|
||||||
type: number
|
|
||||||
deleted:
|
|
||||||
type: number
|
|
||||||
locked:
|
|
||||||
type: number
|
|
||||||
pinned:
|
|
||||||
type: number
|
|
||||||
upvotes:
|
|
||||||
type: number
|
|
||||||
downvotes:
|
|
||||||
type: number
|
|
||||||
deleterUid:
|
|
||||||
type: number
|
|
||||||
titleRaw:
|
titleRaw:
|
||||||
type: string
|
type: string
|
||||||
timestampISO:
|
|
||||||
type: string
|
|
||||||
lastposttimeISO:
|
|
||||||
type: string
|
|
||||||
votes:
|
|
||||||
type: number
|
|
||||||
@@ -30,62 +30,18 @@ get:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
allOf:
|
allOf:
|
||||||
|
- $ref: ../../components/schemas/TopicObject.yaml#/TopicObjectSlim
|
||||||
- type: object
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
tid:
|
|
||||||
type: number
|
|
||||||
description: A topic identifier
|
|
||||||
uid:
|
|
||||||
type: number
|
|
||||||
description: A user identifier
|
|
||||||
cid:
|
|
||||||
type: number
|
|
||||||
description: A category identifier
|
|
||||||
title:
|
title:
|
||||||
type: string
|
type: string
|
||||||
slug:
|
slug:
|
||||||
type: string
|
type: string
|
||||||
timestamp:
|
|
||||||
type: number
|
|
||||||
lastposttime:
|
|
||||||
type: number
|
|
||||||
postcount:
|
|
||||||
type: number
|
|
||||||
viewcount:
|
|
||||||
type: number
|
|
||||||
postercount:
|
|
||||||
type: number
|
|
||||||
description: The number of unique users who made a post in this topic
|
|
||||||
mainPid:
|
|
||||||
type: number
|
|
||||||
description: The post id of the first post in this topic (also called the
|
|
||||||
"original post")
|
|
||||||
teaserPid:
|
teaserPid:
|
||||||
type: number
|
type: number
|
||||||
nullable: true
|
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:
|
titleRaw:
|
||||||
type: string
|
type: string
|
||||||
timestampISO:
|
|
||||||
type: string
|
|
||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
|
||||||
lastposttimeISO:
|
|
||||||
type: string
|
|
||||||
votes:
|
|
||||||
type: number
|
|
||||||
tags:
|
tags:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
|
|||||||
@@ -22,61 +22,19 @@ get:
|
|||||||
topics:
|
topics:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
allOf:
|
||||||
|
- $ref: ../components/schemas/TopicObject.yaml#/TopicObjectSlim
|
||||||
|
- type: object
|
||||||
properties:
|
properties:
|
||||||
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:
|
title:
|
||||||
type: string
|
type: string
|
||||||
slug:
|
slug:
|
||||||
type: string
|
type: string
|
||||||
timestamp:
|
|
||||||
type: number
|
|
||||||
lastposttime:
|
|
||||||
type: number
|
|
||||||
postcount:
|
|
||||||
type: number
|
|
||||||
viewcount:
|
|
||||||
type: number
|
|
||||||
postercount:
|
|
||||||
type: number
|
|
||||||
teaserPid:
|
teaserPid:
|
||||||
type: number
|
type: number
|
||||||
nullable: true
|
nullable: true
|
||||||
upvotes:
|
|
||||||
type: number
|
|
||||||
downvotes:
|
|
||||||
type: number
|
|
||||||
deleterUid:
|
|
||||||
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
|
|
||||||
titleRaw:
|
titleRaw:
|
||||||
type: string
|
type: string
|
||||||
timestampISO:
|
|
||||||
type: string
|
|
||||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
|
||||||
lastposttimeISO:
|
|
||||||
type: string
|
|
||||||
votes:
|
|
||||||
type: number
|
|
||||||
category:
|
category:
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
|||||||
Reference in New Issue
Block a user