Skip to content

v0.16.0

Choose a tag to compare

@mertcanaltin mertcanaltin released this 23 May 18:03
· 31 commits to master since this release

Added

  • defineSchema helper and the exported JSONSchema type. Wrap a plain schema object in defineSchema(...) to author it inline in TypeScript with keyword autocomplete and value checking, no as const needed. Identity at runtime, so the result drops straight into Validator, toStandaloneModule, and the rest of the API. Requires TypeScript >= 5.0.
  • OpenAPI nullable keyword. { type: 'string', nullable: true } accepts null alongside the declared type.

Fixed

  • coerceTypes with type: 'array' wraps a scalar into a single-element array instead of leaving it unchanged.
  • Codegen resolves a $defs entry that carries a fragment $id and is reached through a pointer $ref.
  • Preprocessing (defaults, coercion, removeAdditional) guards against null and non-object data instead of throwing.