refactor: teaser object schema to its own file

This commit is contained in:
Julian Lam
2026-02-13 12:20:21 -05:00
parent 3e2070b2c3
commit 1869b807f2
8 changed files with 63 additions and 415 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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:

View File

@@ -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:

View File

@@ -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: