- License
- Apache-2.0
- Install Size
- 21.3 kB/-
- Vulns
- 0
- Published
$
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/schemaJSON-Schema
JSON-Schema API
Notes
additionalProperties
https://github.com/OAI/OpenAPI-Specification/pull/1548
- JSON-Schema.
additionalPropertiesdefaults totrue. - OpenAPI 2.0.
additionalPropertiesdefaults tofalse. - OpenAPI 3.0.2. "Consistent with JSON Schema,
additionalPropertiesdefaults totrue." https://github.com/OAI/OpenAPI-Specification/blob/v3.0.2-dev/versions/3.0.2.md
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
}