# Any Decorator validation swagger schema input

Module
import { Any } from "@tsed/schema"
Source/packages/schema/src/decorators/common/any.ts

# Overview

function Any(...types: (JSONSchema6TypeName | Type<any> | any)[]): (...args: any[]) => any;

# Description

Set the type of the array items.

WARNING

This decorator will be removed in v7. For v6 user, use AnyDecorator from @tsed/schema instead of @tsed/common.

# Example

class Model {
   @Any()
   property: any;

   @Any(String, Number, Boolean)
   property: string | number | boolean;
}
1
2
3
4
5
6
7

Will produce:

{
  "type": "object",
  "properties": {
    "property": {
      "type": ["integer", "number", "string", "boolean", "array", "object", "null"]
    }
  }
}
1
2
3
4
5
6
7
8

Other topics