# Decorator Nullable

Decorator validation swagger schema input
Module
import { Nullable } from "@tsed/schema"
Source/packages/schema/src/decorators/common/nullable.ts

# Overview

function Nullable(...types: (JSONSchema6TypeName | Type<any> | any)[]): any;

# Description

Set field as nullable.

# Example

class Model {
   @Nullable(Date)
   property: Date | null;

   @Nullable(String, Number, Boolean)
   property: string | number | boolean | null;
}
1
2
3
4
5
6
7

Other topics