Skip to content

object

@tsed/schema

Usage

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

See /packages/specs/schema/src/types/fn/object.ts.

Overview

ts
function object(properties?: {
    [key: string]: JsonSchema;
}): JsonSchema;

Description

Declare a new object model.

See JsonSchema to discover available methods.

Example

typescript
const userSchema = object({
  name: string(),
  age: number()
});

[key: string]

ts
[key: string]: JsonSchema;

Released under the MIT License.