From ba53205020f6285cf78928120e7b79cb1171d93b Mon Sep 17 00:00:00 2001 From: Aleksi Pekkala Date: Thu, 31 Dec 2020 14:11:36 +0900 Subject: [PATCH] Handle Allow --- __tests__/index.test.ts | 7 ++++++- src/defaultConverters.ts | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/__tests__/index.test.ts b/__tests__/index.test.ts index 208f324..7d36cf1 100644 --- a/__tests__/index.test.ts +++ b/__tests__/index.test.ts @@ -1,5 +1,6 @@ // tslint:disable:no-submodule-imports import { + Allow, ArrayMaxSize, ArrayNotContains, IsBoolean, @@ -35,6 +36,9 @@ class User { @IsNotEmptyObject() @IsOptional() nonEmptyObject: {} + + @Allow() + any: unknown } // @ts-ignore: not referenced @@ -134,6 +138,7 @@ describe('classValidatorConverter', () => { id: { type: 'string' }, object: { type: 'object' }, nonEmptyObject: { type: 'object', minProperties: 1 }, + any: {}, tags: { items: { maxLength: 20, @@ -146,7 +151,7 @@ describe('classValidatorConverter', () => { type: 'array', }, }, - required: ['id', 'firstName', 'object'], + required: ['id', 'firstName', 'object', 'any'], type: 'object', }, }) diff --git a/src/defaultConverters.ts b/src/defaultConverters.ts index 9a1910d..3871f51 100644 --- a/src/defaultConverters.ts +++ b/src/defaultConverters.ts @@ -37,6 +37,7 @@ export const defaultConverters: ISchemaConverters = { return targetToSchema(childType, options) } }, + [cv.ValidationTypes.WHITELIST]: {}, [cv.ValidationTypes.CONDITIONAL_VALIDATION]: {}, [cv.ValidationTypes.IS_DEFINED]: {}, [cv.EQUALS]: (meta) => {