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
|
||||
mainPid:
|
||||
type: number
|
||||
description: The post id of the first post in this topic (also called the
|
||||
"original post")
|
||||
description: The post id of the first post in this topic (also called the "original post")
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
@@ -55,6 +54,7 @@ TopicObject:
|
||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||
lastposttimeISO:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string (complementing `lastposttime`)
|
||||
votes:
|
||||
type: number
|
||||
category:
|
||||
@@ -230,5 +230,65 @@ TopicObject:
|
||||
description: A topic identifier
|
||||
thumb:
|
||||
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:
|
||||
- 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:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: ../../../components/schemas/TopicObject.yaml#/TopicObjectSlim
|
||||
- type: object
|
||||
properties:
|
||||
tid:
|
||||
type: number
|
||||
uid:
|
||||
type: number
|
||||
cid:
|
||||
type: number
|
||||
mainPid:
|
||||
type: number
|
||||
teaserPid:
|
||||
type: number
|
||||
nullable: true
|
||||
@@ -32,33 +26,5 @@ get:
|
||||
type: string
|
||||
slug:
|
||||
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:
|
||||
type: string
|
||||
timestampISO:
|
||||
type: string
|
||||
lastposttimeISO:
|
||||
type: string
|
||||
votes:
|
||||
type: number
|
||||
@@ -30,62 +30,18 @@ get:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- $ref: ../../components/schemas/TopicObject.yaml#/TopicObjectSlim
|
||||
- type: object
|
||||
properties:
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
uid:
|
||||
type: number
|
||||
description: A user identifier
|
||||
cid:
|
||||
type: number
|
||||
description: A category identifier
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
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:
|
||||
type: number
|
||||
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
|
||||
tags:
|
||||
type: array
|
||||
items:
|
||||
|
||||
@@ -22,61 +22,19 @@ get:
|
||||
topics:
|
||||
type: array
|
||||
items:
|
||||
type: object
|
||||
allOf:
|
||||
- $ref: ../components/schemas/TopicObject.yaml#/TopicObjectSlim
|
||||
- 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")
|
||||
title:
|
||||
type: string
|
||||
slug:
|
||||
type: string
|
||||
timestamp:
|
||||
type: number
|
||||
lastposttime:
|
||||
type: number
|
||||
postcount:
|
||||
type: number
|
||||
viewcount:
|
||||
type: number
|
||||
postercount:
|
||||
type: number
|
||||
teaserPid:
|
||||
type: number
|
||||
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:
|
||||
type: string
|
||||
timestampISO:
|
||||
type: string
|
||||
description: An ISO 8601 formatted date string (complementing `timestamp`)
|
||||
lastposttimeISO:
|
||||
type: string
|
||||
votes:
|
||||
type: number
|
||||
category:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
Reference in New Issue
Block a user