Skip to main content

SchemaEntry

Signature

export type SchemaEntry<Schema extends UnknownSchema = UnknownSchema> = {
/** The schema node being processed */
schema: Schema;
/** JSON pointer path of the current node */
path: string;
/** Data pointer path corresponding to the current node */
dataPath: string;
/** Traversal depth */
depth: number;
/** Whether there is a reference */
hasReference?: boolean;
/**
* When `hasReference` is `true`, why the `$ref` was left in place instead of
* being inlined: `'cycle'` (already being resolved on the current path),
* `'unresolved'` (resolver returned nothing), or `'definition'` (the node
* lives under `$defs`/`definitions`, so it is intentionally not resolved).
*/
referenceSkipped?: 'cycle' | 'unresolved' | 'definition';
/** Processed reference path */
referencePath?: string;
/** Whether reference is resolved */
referenceResolved?: boolean;
} & ({
keyword: CompositionKeyword;
variant: number;
} | {
keyword: ItemsKeyword;
variant?: number;
} | {
keyword: DefinitionKeyword | PropertiesKeyword;
variant: string;
} | {
keyword: ConditionalKeyword | AdditionalPropertiesKeyword;
} | {
keyword?: never;
})