# ExclusiveMinimum Decorator

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

# Overview

function ExclusiveMinimum(minimum: number, exclusiveMinimum?: boolean): (...parameters: any[]) => any;

# Description

The value of exclusiveMinimum MUST be number, representing an exclusive upper limit for a numeric instance.

If the instance is a number, then the instance is valid only if it has a value strictly greater than (not equal to) exclusiveMinimum.

# Example

# With primitive type

class Model {
   @ExclusiveMinimum(10)
   property: number;
}
1
2
3
4

Will produce:

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

# With array type

class Model {
   @ExclusiveMinimum(10)
   @PropertyType(Number)
   property: number[];
}
1
2
3
4
5

Will produce:

{
  "type": "object",
  "properties": {
    "property": {
      "type": "array",
      "items": {
         "type": "number",
         "exclusiveMinimum": 10
      }
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12