types.IJsonSchema - ZeMA-gGmbH/NoPE-JS GitHub Wiki

Interface: IJsonSchema

types.IJsonSchema

Definition for a JSON Schema

Export

IJsonSchema

Properties

$id

Optional $id: string

This is important because it tells refs where the root of the document is located


$ref

Optional $ref: string


$schema

Optional $schema: string


additionalItems

Optional additionalItems: boolean | IJsonSchema


additionalProperties

Optional additionalProperties: boolean | IJsonSchema


allOf

Optional allOf: IJsonSchema[]


anyOf

Optional anyOf: IJsonSchema[]


default

Optional default: any

Default json for the object represented by


definitions

Optional definitions: Object

Holds simple JSON Schema definitions for referencing from elsewhere.

Index signature

▪ [key: string]: IJsonSchema


dependencies

Optional dependencies: Object

If the key is present as a property then the string of properties must also be present. If the value is a JSON Schema then it must also be valid for the object if the key is present.

Index signature

▪ [key: string]: IJsonSchema | string[]


description

Optional description: string

Schema description


enum

Optional enum: any[]

Enumerates the values that this schema can be e.g.

{ "type": "string", "enum": ["red", "green", "blue"] }


examples

Optional examples: any


exclusiveMaximum

Optional exclusiveMaximum: boolean

If true maximum must be > value, >= otherwise


exclusiveMinimum

Optional exclusiveMinimum: boolean

If true minimum must be < value, <= otherwise


items

Optional items: IJsonSchema | IJsonSchema[]


maxItems

Optional maxItems: number


maxLength

Optional maxLength: number


maxProperties

Optional maxProperties: number


maximum

Optional maximum: number


minItems

Optional minItems: number


minLength

Optional minLength: number


minProperties

Optional minProperties: number


minimum

Optional minimum: number


multipleOf

Optional multipleOf: number

The value must be a multiple of the number (e.g. 10 is a multiple of 5)


not

Optional not: IJsonSchema

The entity being validated must not match this schema


oneOf

Optional oneOf: IJsonSchema[]


pattern

Optional pattern: string

This is a regex string that the value must conform to


patternProperties

Optional patternProperties: Object

The key of this object is a regex for which properties the schema applies to

Index signature

▪ [pattern: string]: IJsonSchema


properties

Optional properties: Object

The keys that can exist on the object with the json schema that should validate their value

Index signature

▪ [property: string]: IJsonSchema


required

Optional required: string[]

Props that must be integrated


title

Optional title: string

Title of the schema


type

Optional type: IJsonSchemaTypes

The basic type of this schema, can be one of ['string' | 'number' | 'object' | 'array' | 'boolean' | 'null'] or an array of the acceptable types


uniqueItems

Optional uniqueItems: boolean