Skip to content

Commit

Permalink
test: fix spec for topic thumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Feb 16, 2021
1 parent 1d9ade4 commit 4c07808
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 93 deletions.
166 changes: 89 additions & 77 deletions public/openapi/components/schemas/TopicObject.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@ TopicObject:
properties:
lastposttime:
type: number
thumbs:
type: array
items:
type: object
properties:
id:
type: number
description: The topic id
name:
type: string
description: The topic thumbnail filename
url:
type: string
description: Relative path to the topic thumbnail
category:
type: object
properties:
Expand Down Expand Up @@ -202,66 +188,92 @@ TopicObject:
- 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
title:
type: string
slug:
type: string
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
titleRaw:
type: string
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
teaserPid:
oneOf:
- type: number
- type: string
nullable: true
allOf:
- 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
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
titleRaw:
type: string
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
teaserPid:
oneOf:
- type: number
- type: string
nullable: true
thumbs:
type: array
items:
type: object
properties:
id:
type: number
description: The topic id
name:
type: string
description: The topic thumbnail filename
url:
type: string
description: Relative path to the topic thumbnail
- 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
numThumbs:
type: number
description: The number of thumbnails associated with this topic
required:
- tid
8 changes: 0 additions & 8 deletions public/openapi/read/topic/topic_id.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ get:
type: array
items:
$ref: ../../components/schemas/TagObject.yaml#/TagObject
thumbs:
type: array
items:
type: object
properties:
url:
type: string
description: Relative path to the topic thumbnail
posts:
type: array
items:
Expand Down
8 changes: 0 additions & 8 deletions public/openapi/read/unread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ get:
nullable: true
titleRaw:
type: string
thumbs:
type: array
items:
type: object
properties:
url:
type: string
description: Relative path to the topic thumbnail
category:
type: object
properties:
Expand Down

0 comments on commit 4c07808

Please sign in to comment.