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: CrosspostObject:
type: object anyOf:
properties: - type: object
id: properties:
type: string id:
description: The cross-post ID type: string
cid: description: The cross-post ID
type: object cid:
description: The category id that the topic was cross-posted to type: object
additionalProperties: description: The category id that the topic was cross-posted to
oneOf: additionalProperties:
- type: string oneOf:
- type: number - type: string
tid: - type: number
type: object tid:
description: The topic id that was cross-posted type: object
additionalProperties: description: The topic id that was cross-posted
oneOf: additionalProperties:
- type: string oneOf:
- type: number - type: string
timestamp: - type: number
type: number timestamp:
uid: type: number
type: object uid:
description: The user id that initiated the cross-post type: object
additionalProperties: description: The user id that initiated the cross-post
oneOf: additionalProperties:
- type: string oneOf:
- type: number - 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: CrosspostsArray:
type: array type: array
description: A list of crosspost objects description: A list of crosspost objects

View File

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