Skip to content

array

@tsed/schema

Usage

typescript
import { array } from "@tsed/schema";

See /packages/specs/schema/src/fn/collection.ts.

Overview

ts
function array(): JsonSchema<any[]>;
export function array<I>(item: JsonSchema<I>): JsonSchema<I[]>;

Description

Declare a new array model. If an item schema is provided, it will be set as items and its type will be inferred.

json
{ "type": "array" }

See JsonSchema to discover available methods.

Released under the MIT License.