From 4c078084dcea3ab02d57e2581881ecf2af8024b1 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Tue, 16 Feb 2021 12:40:25 -0500 Subject: [PATCH] test: fix spec for topic thumbs --- .../components/schemas/TopicObject.yaml | 166 ++++++++++-------- public/openapi/read/topic/topic_id.yaml | 8 - public/openapi/read/unread.yaml | 8 - 3 files changed, 89 insertions(+), 93 deletions(-) diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yaml index 62b08d911a..db8259b70e 100644 --- a/public/openapi/components/schemas/TopicObject.yaml +++ b/public/openapi/components/schemas/TopicObject.yaml @@ -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: @@ -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 \ No newline at end of file + 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 \ No newline at end of file diff --git a/public/openapi/read/topic/topic_id.yaml b/public/openapi/read/topic/topic_id.yaml index 0513d711af..b013de211c 100644 --- a/public/openapi/read/topic/topic_id.yaml +++ b/public/openapi/read/topic/topic_id.yaml @@ -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: diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yaml index 479c6c24f0..4d6ad5d902 100644 --- a/public/openapi/read/unread.yaml +++ b/public/openapi/read/unread.yaml @@ -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: