Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Schema

import type { Schema } from "https://googleapis.deno.dev/v1/ces:v1.ts";

Represents a select subset of an OpenAPI 3.0 schema object.

interface Schema {
additionalProperties?: Schema;
anyOf?: Schema[];
default?: any;
defs?: {
[key: string]: Schema;
}
;
description?: string;
enum?: string[];
items?: Schema;
maximum?: number;
maxItems?: bigint;
minimum?: number;
minItems?: bigint;
nullable?: boolean;
prefixItems?: Schema[];
properties?: {
[key: string]: Schema;
}
;
ref?: string;
required?: string[];
title?: string;
type?:
| "TYPE_UNSPECIFIED"
| "STRING"
| "INTEGER"
| "NUMBER"
| "BOOLEAN"
| "OBJECT"
| "ARRAY";
uniqueItems?: boolean;
}

§Properties

§
additionalProperties?: Schema
[src]

Optional. Can either be a boolean or an object, controls the presence of additional properties.

§
anyOf?: Schema[]
[src]

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

§
default?: any
[src]

Optional. Default value of the data.

§
defs?: {
[key: string]: Schema;
}
[src]

Optional. A map of definitions for use by ref. Only allowed at the root of the schema.

§
description?: string
[src]

Optional. The description of the data.

§
enum?: string[]
[src]

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"]}

§
items?: Schema
[src]

Optional. Schema of the elements of Type.ARRAY.

§
maximum?: number
[src]

Optional. Maximum value for Type.INTEGER and Type.NUMBER.

§
maxItems?: bigint
[src]

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

§
minimum?: number
[src]

Optional. Minimum value for Type.INTEGER and Type.NUMBER.

§
minItems?: bigint
[src]

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

§
nullable?: boolean
[src]

Optional. Indicates if the value may be null.

§
prefixItems?: Schema[]
[src]

Optional. Schemas of initial elements of Type.ARRAY.

§
properties?: {
[key: string]: Schema;
}
[src]

Optional. Properties of Type.OBJECT.

§
ref?: string
[src]

Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root defs. For example, the following schema defines a reference to a schema node named "Pet": type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the "pet" property is a reference to the schema node named "Pet". See details in https://json-schema.org/understanding-json-schema/structuring.

§
required?: string[]
[src]

Optional. Required properties of Type.OBJECT.

§
title?: string
[src]

Optional. The title of the schema.

§
type?: "TYPE_UNSPECIFIED" | "STRING" | "INTEGER" | "NUMBER" | "BOOLEAN" | "OBJECT" | "ARRAY"
[src]

Required. The type of the data.

§
uniqueItems?: boolean
[src]

Optional. Indicate the items in the array must be unique. Only applies to TYPE.ARRAY.