chore: improved schema

This commit is contained in:
Morten Olsen
2025-12-10 20:45:02 +01:00
parent d02102977a
commit 0646390d52
16 changed files with 920 additions and 118 deletions

View File

@@ -5,10 +5,12 @@ import {
hasZodFastifySchemaValidationErrors,
isResponseSerializationError,
jsonSchemaTransform,
jsonSchemaTransformObject,
serializerCompiler,
validatorCompiler,
type ZodTypeProvider,
} from 'fastify-type-provider-zod';
import scalar from '@scalar/fastify-api-reference';
import { StashRuntime } from '@morten-olsen/stash-runtime';
import { systemEndpoints } from './endpoints/system/system.js';
@@ -41,10 +43,20 @@ const createApi = async (runtime: StashRuntime = new StashRuntime()) => {
},
},
transform: jsonSchemaTransform,
transformObject: jsonSchemaTransformObject,
});
await app.register(import('@scalar/fastify-api-reference'), {
await app.register(scalar, {
routePrefix: '/docs',
configuration: {
pageTitle: 'Foo',
title: 'Hello World!',
telemetry: false,
hideClientButton: true,
theme: 'laserwave',
persistAuth: true,
orderRequiredPropertiesFirst: false,
},
});
app.setErrorHandler((err, req, reply) => {