Interface DataSchema

interface DataSchema {
    title?: string;
    description?: string;
    type?: string | string[];
    format?: string;
    properties?: {
        [key: string]: DataSchema;
    };
    items?: DataSchema;
    additionalProperties?: boolean | DataSchema;
    enum?: string[];
    referenceRecords?: DataRecord[];
    referenceCollection?: {
        key: any;
        parameters?: Record<string, any>;
    };
    referenceUdm?: string;
    default?: any;
    allowCustom?: boolean;
    $ref?: string;
    required?: string[];
    minLength?: number;
    maxLength?: number;
    minimum?: number;
    maximum?: number;
    maxItems?: number;
    readOnly?: boolean;
    writeOnly?: boolean;
    examples?: any[];
    anyOf?: DataSchema[];
    isImplied?: boolean;
    referenceCollectionPath?: string;
    referenceCollectionUri?: string;
}

Properties

title?: string

Human-readable name of the schema.

description?: string

Additional information about the field.

type?: string | string[]

Schema type.

format?: string

Format for strings.

properties?: {
    [key: string]: DataSchema;
}

Properties for object schema

items?: DataSchema

Schema for array items

additionalProperties?: boolean | DataSchema

For object schemas - whether value can contain properties besides ones listed in properties.

enum?: string[]

List of possible values for string schema.

referenceRecords?: DataRecord[]

List of Data Records that can be used as possible values.

referenceCollection?: {
    key: any;
    parameters?: Record<string, any>;
}

Pointer to a collection containing records that can be used as possible values.

referenceUdm?: string

For UDM schemas - reference to another UDM

default?: any

Default value that will be used if none is provided.

allowCustom?: boolean

If true, schema allows custom values besides ones in enum, referenceRecords, or refrenceCollectionPath.

$ref?: string

Reference to an App Data Schema

required?: string[]

List of required properties for object schema

minLength?: number

Minimum lenght of a string

maxLength?: number

Maximum length of a string

minimum?: number

Minimum value for a number

maximum?: number

Maximum value for a number

maxItems?: number

Maximum items for array

readOnly?: boolean

If field can be only read

writeOnly?: boolean

If field can be only written but is not returned in responses

examples?: any[]

Examples of the field value

anyOf?: DataSchema[]
isImplied?: boolean

Used to indicate that field was not explicitly defined in the schema, but implied from the value.

referenceCollectionPath?: string
  • use referenceCollection instead
referenceCollectionUri?: string