Skip to main content

Function: auditSchemaProblems()

auditSchemaProblems(schema, path?): string[]

Defined in: packages/contracts/src/schemas/audit-check.ts:27

Walks one schema and reports every place it leaves the audit identifier vocabulary (28, section 8; N171). The vocabulary is: a string with a pattern or the date-time format, a constant or an enumeration, an integer, a boolean, and an object or an array of those. Everything else is reported, notably:

  • a string with no pattern, which is free text;
  • a non-integer number, which cannot be canonicalized;
  • an unconstrained value (Unknown, Any), a record, or an object that does not say additionalProperties: false;
  • an array with no maxItems.

Parameters​

schema​

unknown

A TypeBox (JSON Schema) value.

path?​

string = ''

Where it sits, for the message.

Returns​

string[]

Human-readable problems; empty when the schema is inside the vocabulary.