# Any Decorator validation swagger schema
Module | import { Any } from "@tsed/common" |
---|---|
Source | /packages/common/src/jsonschema/decorators/any.ts |
# Overview
function Any(...types: (JSONSchema6TypeName | Type<any> | null)[]): (...parameters: any[]) => any;
# Description
Set the type of the array items.
WARNING
For v6 user, use from @tsed/schema instead of @tsed/common.
# Example
class Model {
@Any()
property: any;
}
1
2
3
4
2
3
4
Will produce:
{
"type": "object",
"properties": {
"property": {
"type": ["integer", "number", "string", "boolean", "array", "object", "null"]
}
}
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing