# Decorator Nullable
Decorator validation swagger schema inputModule | 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
2
3
4
5
6
7
Other topics
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Seq
- OIDC
- Stripe
- Controllers
- Providers
- Model
- JsonMapper
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Exceptions
- Hooks
- Response Filter
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing