chore: improved schema
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user