docs: update openapi schema for missing routes related to crossposting

This commit is contained in:
Julian Lam
2026-01-05 12:24:00 -05:00
parent add163a42d
commit d81b644d7f
3 changed files with 78 additions and 28 deletions

View File

@@ -1,32 +1,50 @@
CrosspostObject:
type: object
properties:
id:
type: string
description: The cross-post ID
cid:
type: object
description: The category id that the topic was cross-posted to
additionalProperties:
oneOf:
- type: string
- type: number
tid:
type: object
description: The topic id that was cross-posted
additionalProperties:
oneOf:
- type: string
- type: number
timestamp:
type: number
uid:
type: object
description: The user id that initiated the cross-post
additionalProperties:
oneOf:
- type: string
- type: number
anyOf:
- type: object
properties:
id:
type: string
description: The cross-post ID
cid:
type: object
description: The category id that the topic was cross-posted to
additionalProperties:
oneOf:
- type: string
- type: number
tid:
type: object
description: The topic id that was cross-posted
additionalProperties:
oneOf:
- type: string
- type: number
timestamp:
type: number
uid:
type: object
description: The user id that initiated the cross-post
additionalProperties:
oneOf:
- type: string
- type: number
- type: object
properties:
category:
type: object
properties:
cid:
type: number
name:
type: string
icon:
type: string
bgColor:
type: string
color:
type: string
slug:
type: string
CrosspostsArray:
type: array
description: A list of crosspost objects

View File

@@ -212,6 +212,10 @@ get:
isLocal:
type: boolean
description: Whether the user belongs to the local installation or not.
crossposts:
type: array
items:
$ref: ../../components/schemas/CrosspostObject.yaml#/CrosspostObject
- 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:

View File

@@ -1,3 +1,31 @@
get:
tags:
- topics
summary: get topic crossposts
description: This operation retrieves a list of crossposts for the requested topic
parameters:
- in: path
name: tid
schema:
type: string
required: true
description: a valid topic id
example: 1
responses:
'200':
description: Topic crossposts retrieved
content:
application/json:
schema:
type: object
properties:
status:
$ref: ../../../components/schemas/Status.yaml#/Status
response:
type: object
properties:
crossposts:
$ref: ../../../components/schemas/CrosspostObject.yaml#/CrosspostsArray
post:
tags:
- topics