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 - icon:bgColor
- banned_until_readable - banned_until_readable
teaser: teaser:
type: object $ref: './TeaserObject.yaml#/TeaserObject'
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
tags: tags:
type: array type: array
items: items:

View File

@@ -197,58 +197,7 @@ get:
title: title:
type: string type: string
teaser: teaser:
type: object $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
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'
imageClass: imageClass:
type: string type: string
- $ref: ../components/schemas/Pagination.yaml#/Pagination - $ref: ../components/schemas/Pagination.yaml#/Pagination

View File

@@ -199,58 +199,7 @@ get:
title: title:
type: string type: string
teaser: teaser:
type: object $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
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.
imageClass: imageClass:
type: string type: string
- $ref: ../components/schemas/Pagination.yaml#/Pagination - $ref: ../components/schemas/Pagination.yaml#/Pagination

View File

@@ -150,53 +150,7 @@ get:
fullname: fullname:
type: string type: string
teaser: teaser:
type: object $ref: ../../components/schemas/TeaserObject.yaml#/TeaserObject
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
tags: tags:
type: array type: array
items: items:

View File

@@ -127,61 +127,7 @@ get:
- icon:bgColor - icon:bgColor
- banned_until_readable - banned_until_readable
teaser: teaser:
type: object $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
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
tags: tags:
type: array type: array
items: items:

View File

@@ -264,60 +264,7 @@ get:
unread: unread:
type: boolean type: boolean
teaser: teaser:
type: object $ref: ../../../../components/schemas/TeaserObject.yaml#/TeaserObject
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
lastUser: lastUser:
type: object type: object
properties: properties:
@@ -428,58 +375,7 @@ get:
unread: unread:
type: boolean type: boolean
teaser: teaser:
type: object $ref: ../../../../components/schemas/TeaserObject.yaml#/TeaserObject
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
lastUser: lastUser:
type: object type: object
properties: properties:

View File

@@ -47,54 +47,7 @@ get:
type: boolean type: boolean
description: Whether or not the chat has unread messages within description: Whether or not the chat has unread messages within
teaser: teaser:
type: object $ref: ../components/schemas/TeaserObject.yaml#/TeaserObject
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
users: users:
type: array type: array
items: items: