mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
579 B
18 lines
579 B
import type { FastifyInstance } from 'fastify'
|
|
import { FLAGS } from '../../models/flags.ts'
|
|
|
|
export async function registerSchemas(app: FastifyInstance): Promise<void> {
|
|
/**
|
|
* SYSTEM FLAGS - Used both ways: as the response, and as a partial update body
|
|
*
|
|
* Built from the model's own list, so a new flag is exposed and documented by declaring it there.
|
|
*/
|
|
app.addSchema({
|
|
$id: 'SystemFlags',
|
|
type: 'object',
|
|
properties: Object.fromEntries(
|
|
Object.entries(FLAGS).map(([key, description]) => [key, { type: 'boolean', description }])
|
|
)
|
|
})
|
|
}
|