2 ms·
See n2d4's comment but also AJV's JSONSchemaType import { JSONSchemaType } from 'ajv' It will bridge the JSON Schema and TypeScript types We've found this us
by erikerikson 2y ago
See n2d4's comment but also AJV's JSONSchemaType
import { JSONSchemaType } from 'ajv'
It will bridge the JSON Schema and TypeScript types
We've found this useful too:
import { OpenAPIV3_1 as oa } from 'openapi-types'
export type Schema<T> = JSONSchemaType<T> & oa.SchemaObject
We validate that the type aligns with the schema and load the schema to validate all incoming requests