@ts-common/schema

v0.0.5
  • Types
  • ESM
  • CJS
License
Apache-2.0
Install Size
21.3 kB/-
Vulns
0
Published

Get started

$npm install @ts-common/schema
$pnpm add @ts-common/schema
$yarn add @ts-common/schema
$bun add @ts-common/schema
$deno add npm:@ts-common/schema
$vlt install @ts-common/schema

Readme

JSON-Schema

JSON-Schema API

Notes

additionalProperties

https://github.com/OAI/OpenAPI-Specification/pull/1548

A simplified version of OpenAPI can introduce a global configuration field additionalProperties. A strict version of OpenAPI should require the additionalProperties property if type is object.

Default values

if Schema defines a default value then a validation step may produce a value of type which has no undefined values. For example

interface A {
    a?: string
}

transforms into

interface A {
    a: string
}
Multi API versions in one file