Skip to content

Node.js based forum software built for the modern web

refactor: teaser object schema to its own file

Julian Lam1869b807f2f5
diff --git a/public/openapi/components/schemas/TeaserObject.yaml b/public/openapi/components/schemas/TeaserObject.yaml
new file mode 100644
index 0000000000..93eeafa86e
--- /dev/null
+++ b/public/openapi/components/schemas/TeaserObject.yaml
@@ -0,0 +1,55 @@
+TeaserObject:
+ type: object
+ properties:
+ roomId:
+ type: number
+ fromuid:
+ type: number
+ content:
+ type: string
+ timestamp:
+ type: number
+ timestampISO:
+ type: string
+ description: An ISO 8601 formatted date string (complementing `timestamp`)
+ user:
+ type: object
+ properties:
+ uid:
+ type: number
+ description: A user identifier
+ isLocal:
+ type: boolean
+ description: Whether the user belongs to the local installation or not.
+ 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
+ userslug:
+ type: string
+ description: An URL-safe variant of the username (i.e. lower-cased, spaces
+ removed, etc.)
+ picture:
+ nullable: true
+ type: string
+ status:
+ type: string
+ lastonline:
+ type: number
+ 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"
+ lastonlineISO:
+ type: string
+ nullable: true
diff --git a/public/openapi/components/schemas/TopicObject.yaml b/public/openapi/components/schemas/TopicObject.yaml
index 605c32de85..6a3f212541 100644
--- a/public/openapi/components/schemas/TopicObject.yaml
+++ b/public/openapi/components/schemas/TopicObject.yaml
@@ -94,61 +94,7 @@ TopicObject:
- 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
- sourceContent:
- type: string
- nullable: true
- 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
- displayname:
- type: string
- isLocal:
- type: boolean
- 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
+ $ref: './TeaserObject.yaml#/TeaserObject'
tags:
type: array
items:
diff --git a/public/openapi/read/categories.yaml b/public/openapi/read/categories.yaml
index 76d2375ebb..c78533e267 100644
--- a/public/openapi/read/categories.yaml
+++ b/public/openapi/read/categories.yaml
@@ -197,58 +197,7 @@ get:
title:
type: string
teaser:
- type: object
- properties:
- url:
- type: string
- timestampISO:
- type: string
- description: An ISO 8601 formatted date string (complementing `timestamp`)
- pid:
- type: number
- tid:
- type: number
- index:
- type: number
- description: The index of the post
- topic:
- type: object
- properties:
- tid:
- type: number
- slug:
- type: string
- title:
- type: string
- user:
- type: object
- properties:
- uid:
- type: number
- example: 1
- isLocal:
- type: boolean
- description: Whether the user belongs to the local installation or not.
- username:
- type: string
- example: Dragon Fruit
- userslug:
- type: string
- example: dragon-fruit
- picture:
- type: string
- example: 'https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80'
- nullable: true
- displayname:
- type: string
- description: This is either username or fullname depending on forum and user settings
- example: Dragon Fruit
- 'icon:text':
- type: string
- example: D
- 'icon:bgColor':
- type: string
- example: '#9c27b0'
+ $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
imageClass:
type: string
- $ref: ../components/schemas/Pagination.yaml#/Pagination
diff --git a/public/openapi/read/index.yaml b/public/openapi/read/index.yaml
index 4c45da4360..56e4048340 100644
--- a/public/openapi/read/index.yaml
+++ b/public/openapi/read/index.yaml
@@ -199,58 +199,7 @@ get:
title:
type: string
teaser:
- type: object
- properties:
- url:
- type: string
- timestampISO:
- type: string
- description: An ISO 8601 formatted date string (complementing `timestamp`)
- pid:
- type: number
- tid:
- type: number
- index:
- type: number
- description: The index of the post
- topic:
- type: object
- properties:
- tid:
- type: number
- slug:
- type: string
- title:
- type: string
- user:
- type: object
- properties:
- uid:
- type: number
- example: 1
- username:
- type: string
- example: Dragon Fruit
- userslug:
- type: string
- example: dragon-fruit
- picture:
- type: string
- example: 'https://images.unsplash.com/photo-1560070094-e1f2ddec4337?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=256&h=256&q=80'
- nullable: true
- displayname:
- type: string
- description: This is either username or fullname depending on forum and user settings
- example: Dragon Fruit
- 'icon:text':
- type: string
- example: D
- 'icon:bgColor':
- type: string
- example: '#9c27b0'
- isLocal:
- type: boolean
- description: Whether the user belongs to the local installation or not.
+ $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
imageClass:
type: string
- $ref: ../components/schemas/Pagination.yaml#/Pagination
diff --git a/public/openapi/read/tags/tag.yaml b/public/openapi/read/tags/tag.yaml
index c9a49c5160..409ffb150b 100644
--- a/public/openapi/read/tags/tag.yaml
+++ b/public/openapi/read/tags/tag.yaml
@@ -150,53 +150,7 @@ get:
fullname:
type: string
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
+ $ref: ../../components/schemas/TeaserObject.yaml#/TeaserObject
tags:
type: array
items:
diff --git a/public/openapi/read/unread.yaml b/public/openapi/read/unread.yaml
index 6ae0e8500e..516299c1fc 100644
--- a/public/openapi/read/unread.yaml
+++ b/public/openapi/read/unread.yaml
@@ -127,61 +127,7 @@ get:
- icon:bgColor
- banned_until_readable
teaser:
- type: object
- nullable: true
- properties:
- pid:
- type: number
- uid:
- type: number
- description: A user identifier
- timestamp:
- type: number
- tid:
- type: number
- description: A topic identifier
- content:
- type: string
- sourceContent:
- type: string
- nullable: true
- 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
- displayname:
- type: string
- isLocal:
- type: boolean
- 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
+ $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
tags:
type: array
items:
diff --git a/public/openapi/read/user/userslug/chats/roomid.yaml b/public/openapi/read/user/userslug/chats/roomid.yaml
index 448f350a42..4468d9c0a1 100644
--- a/public/openapi/read/user/userslug/chats/roomid.yaml
+++ b/public/openapi/read/user/userslug/chats/roomid.yaml
@@ -264,60 +264,7 @@ get:
unread:
type: boolean
teaser:
- type: object
- properties:
- roomId:
- type: number
- fromuid:
- type: number
- content:
- type: string
- timestamp:
- type: number
- timestampISO:
- type: string
- description: An ISO 8601 formatted date string (complementing `timestamp`)
- user:
- type: object
- properties:
- uid:
- type: number
- description: A user identifier
- isLocal:
- type: boolean
- description: Whether the user belongs to the local installation or not.
- 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
- userslug:
- type: string
- description: An URL-safe variant of the username (i.e. lower-cased, spaces
- removed, etc.)
- picture:
- nullable: true
- type: string
- status:
- type: string
- lastonline:
- type: number
- 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"
- lastonlineISO:
- type: string
- nullable: true
+ $ref: ../../../../components/schemas/TeaserObject.yaml#/TeaserObject
lastUser:
type: object
properties:
@@ -428,58 +375,7 @@ get:
unread:
type: boolean
teaser:
- type: object
- properties:
- fromuid:
- type: number
- content:
- type: string
- timestamp:
- type: number
- timestampISO:
- type: string
- description: An ISO 8601 formatted date string (complementing `timestamp`)
- user:
- type: object
- properties:
- uid:
- type: number
- description: A user identifier
- isLocal:
- type: boolean
- description: Whether the user belongs to the local installation or not.
- 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
- userslug:
- type: string
- description: An URL-safe variant of the username (i.e. lower-cased, spaces
- removed, etc.)
- picture:
- nullable: true
- type: string
- status:
- type: string
- lastonline:
- type: number
- 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"
- lastonlineISO:
- type: string
- nullable: true
+ $ref: ../../../../components/schemas/TeaserObject.yaml#/TeaserObject
lastUser:
type: object
properties:
diff --git a/public/openapi/write/chats.yaml b/public/openapi/write/chats.yaml
index 37204a9b5c..5206482565 100644
--- a/public/openapi/write/chats.yaml
+++ b/public/openapi/write/chats.yaml
@@ -47,54 +47,7 @@ get:
type: boolean
description: Whether or not the chat has unread messages within
teaser:
- type: object
- nullable: true
- properties:
- fromuid:
- type: number
- content:
- type: string
- timestamp:
- type: number
- timestampISO:
- type: string
- 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
- userslug:
- type: string
- description: An URL-safe variant of the username (i.e. lower-cased, spaces
- removed, etc.)
- picture:
- nullable: true
- type: string
- status:
- type: string
- lastonline:
- type: number
- 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"
- lastonlineISO:
- type: string
+ $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
users:
type: array
items: