# CollectionContains Decorator validation swagger schema input collections

Module
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

Other topics