# MinProperties Decorator

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

# Overview

function MinProperties(minProperties: number): (...parameters: any[]) => any;

# Description

An object instance is valid against minProperties if its number of properties is greater than, or equal to, the value of this keyword.

WARNING

The value of this keyword MUST be a non-negative integer.

TIP

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

# Example

class Model {
   @Any()
   @MinProperties(10)
   property: any;
}
1
2
3
4
5

Will produce:

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

:::