# MinItems Decorator

Module
import { MinItems } from "@tsed/common"
Source/packages/common/src/jsonschema/decorators/minItems.ts

# Overview

function MinItems(minItems: number): (...parameters: any[]) => any;

# Description

An array instance is valid against minItems if its size is greater than, or equal to, the value of this keyword.

WARNING

The value minItems MUST be a non-negative integer.

TIP

Omitting this keyword has the same behavior as a value of 0.

# Example

class Model {
   @PropertyType(String)
   @MinItems(10)
   property: string[];
}
1
2
3
4
5

Will produce:

{
  "type": "object",
  "properties": {
    "property": {
      "type": "number",
      "minItems": 10
    }
  }
}
1
2
3
4
5
6
7
8
9

:::