@nestjs/platform-fastify
Version:
Nest - modern, fast, powerful node.js web framework (@platform-fastify)
13 lines (12 loc) • 559 B
JavaScript
import { SetMetadata } from '@nestjs/common';
import { FASTIFY_ROUTE_SCHEMA_METADATA } from '../constants.js';
/**
* @publicApi
* Allows setting the schema for the route. Schema is an object that can contain the following properties:
* - body: JsonSchema
* - querystring or query: JsonSchema
* - params: JsonSchema
* - response: Record<HttpStatusCode, JsonSchema>
* @param schema See {@link https://fastify.dev/docs/latest/Reference/Routes/#routes-options}
*/
export const RouteSchema = (schema) => SetMetadata(FASTIFY_ROUTE_SCHEMA_METADATA, schema);