@directus/api
Version:
Directus is a real-time API and App dashboard for managing SQL database content
14 lines (13 loc) • 864 B
TypeScript
import type { JSONSchema7 } from 'ai';
/**
* Checks whether an input object is *likely* a JSON Schema 7 object
* Limitations:
* - Does NOT validate nested schemas (e.g., inside `properties`, `items`, `definitions`, etc.)
* - Does NOT check for correct usage of combinators (`anyOf`, `allOf`, `oneOf`, `not`)
* - Does NOT verify required/optional keyword relationships (e.g., `required` only valid for object type)
* - Does NOT validate formats, patterns, or constraints (e.g., `pattern`, `minimum`, `maximum`, etc.)
* - Accepts both `definitions` and `$defs` for tolerance, but does not enforce draft-07 strictness
* - Only checks for presence of top-level schema keywords
* This is not a perfect validator, and does not check nested properties or full JSON Schema 7 compliance
*/
export declare const parseJsonSchema7: (schema: unknown) => JSONSchema7;