Interface Schema

Schema that defines the format of input and output data.

Represents a select subset of an OpenAPI 3.0 schema object.

interface Schema {
    anyOf?: Schema[];
    default?: unknown;
    description?: string;
    enum?: string[];
    example?: unknown;
    format?: string;
    items?: Schema;
    maximum?: number;
    maxItems?: string;
    maxLength?: string;
    maxProperties?: string;
    minimum?: number;
    minItems?: string;
    minLength?: string;
    minProperties?: string;
    nullable?: boolean;
    pattern?: string;
    properties?: Record<string, Schema>;
    propertyOrdering?: string[];
    required?: string[];
    title?: string;
    type?: Type;
}

Properties

anyOf?: Schema[]

Optional. The value should be validated against any (one or more) of the subschemas in the list.

default?: unknown

Optional. Default value of the data.

description?: string

Optional. The description of the data.

enum?: string[]

Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101", "201", "301"]}

example?: unknown

Optional. Example of the object. Will only populated when the object is the root.

format?: string

Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc

items?: Schema

Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.

maximum?: number

Optional. Maximum value of the Type.INTEGER and Type.NUMBER

maxItems?: string

Optional. Maximum number of the elements for Type.ARRAY.

maxLength?: string

Optional. Maximum length of the Type.STRING

maxProperties?: string

Optional. Maximum number of the properties for Type.OBJECT.

minimum?: number

Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER

minItems?: string

Optional. Minimum number of the elements for Type.ARRAY.

minLength?: string

Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING

minProperties?: string

Optional. Minimum number of the properties for Type.OBJECT.

nullable?: boolean

Optional. Indicates if the value may be null.

pattern?: string

Optional. Pattern of the Type.STRING to restrict a string to a regular expression.

properties?: Record<string, Schema>

Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.

propertyOrdering?: string[]

Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.

required?: string[]

Optional. Required properties of Type.OBJECT.

title?: string

Optional. The title of the Schema.

type?: Type

Optional. The type of the data.

MMNEPVFCICPMFPCPTTAAATR