Create validation parts for Ajv for objects that extends WithCustomFields interface
Expectation usage:
interface UserPayload extends WithCustomFields { name: string; gender: string; } const userCustomFields = [{ name: 'addressLine1', type: 'string'}] const userSchema: JSONSchemaType = { additionalProperties: false, properties: { name: { type: 'string' }, gender: { nullable: true, type: 'string' }, customFields: createCustomFieldAjvSchemaComponent(userCustomFields) } }
ajv customFields validate parts blocks-6c28
Generated using TypeDoc
Create validation parts for Ajv for objects that extends WithCustomFields interface
Expectation usage:
interface UserPayload extends WithCustomFields { name: string; gender: string; } const userCustomFields = [{ name: 'addressLine1', type: 'string'}] const userSchema: JSONSchemaType = {
additionalProperties: false,
properties: {
name: { type: 'string' },
gender: { nullable: true, type: 'string' },
customFields: createCustomFieldAjvSchemaComponent(userCustomFields)
}
}