by thrance · 2y ago · 0 comments
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