# Decorator CollectionContains
Decorator validation swagger schema input collectionsModule | import { CollectionContains } from "@tsed/schema" |
---|---|
Source | /packages/schema/src/decorators/collections/collectionContains.ts |
# Overview
function CollectionContains(type: any): import("./collectionOf").CollectionOfChainedDecorators;
# Description
Set the type of the item collection. The possible value is String, Boolean, Number, Date, Object, Class, etc...
The array instance will be valid against "contains" if at least one of its elements is valid against the given schema.
class Model {
@CollectionContains(String).MinLength(0).MaxLength(0)
property: string[];
}
1
2
3
4
2
3
4
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