nz-json-schema-form
Version:
Schema form for JSON schema
72 lines (71 loc) • 2.12 kB
TypeScript
export declare enum JSONSchemaTypes {
STRING = "string",
NUMBER = "number",
INTEGER = "integer",
BOOLEAN = "boolean",
OBJECT = "object",
ARRAY = "array",
NULL = "null"
}
export type JSONSchemaTypeName = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array' | 'null';
export type JSONSchemaType = JSONSchemaArray[] | boolean | number | null | object | string;
export interface JSONSchemaArray extends Array<JSONSchemaType> {
}
export type JSONSchemaVersion = string;
export type JSONSchemaDefinition = JSONSchema;
export interface JSONSchema {
$id?: string;
$ref?: string;
$schema?: JSONSchemaVersion;
$comment?: string;
type?: JSONSchemaTypeName;
enum?: JSONSchemaType[];
const?: JSONSchemaType;
multipleOf?: number;
maximum?: number;
exclusiveMaximum?: number;
minimum?: number;
exclusiveMinimum?: number;
maxLength?: number;
minLength?: number;
pattern?: string;
items?: JSONSchemaDefinition | JSONSchemaDefinition[];
additionalItems?: JSONSchemaDefinition;
maxItems?: number;
minItems?: number;
uniqueItems?: boolean;
contains?: JSONSchema;
maxProperties?: number;
minProperties?: number;
required?: string[];
properties?: {
[key: string]: JSONSchemaDefinition;
};
patternProperties?: {
[key: string]: JSONSchemaDefinition;
};
additionalProperties?: JSONSchemaDefinition;
dependencies?: {
[key: string]: JSONSchemaDefinition | string[];
};
propertyNames?: JSONSchemaDefinition;
if?: JSONSchemaDefinition;
then?: JSONSchemaDefinition;
else?: JSONSchemaDefinition;
allOf?: JSONSchemaDefinition[];
anyOf?: JSONSchemaDefinition[];
oneOf?: JSONSchemaDefinition[];
not?: JSONSchemaDefinition;
format?: string;
contentMediaType?: string;
contentEncoding?: string;
definitions?: {
[key: string]: JSONSchemaDefinition;
};
title?: string;
description?: string;
default?: JSONSchemaType;
readOnly?: boolean;
writeOnly?: boolean;
examples?: JSONSchemaType;
}