Skip to content

Commit

Permalink
Handle Allow
Browse files Browse the repository at this point in the history
  • Loading branch information
epiphone committed Dec 31, 2020
1 parent 22258da commit ba53205
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion __tests__/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// tslint:disable:no-submodule-imports
import {
Allow,
ArrayMaxSize,
ArrayNotContains,
IsBoolean,
Expand Down Expand Up @@ -35,6 +36,9 @@ class User {
@IsNotEmptyObject()
@IsOptional()
nonEmptyObject: {}

@Allow()
any: unknown
}

// @ts-ignore: not referenced
Expand Down Expand Up @@ -134,6 +138,7 @@ describe('classValidatorConverter', () => {
id: { type: 'string' },
object: { type: 'object' },
nonEmptyObject: { type: 'object', minProperties: 1 },
any: {},
tags: {
items: {
maxLength: 20,
Expand All @@ -146,7 +151,7 @@ describe('classValidatorConverter', () => {
type: 'array',
},
},
required: ['id', 'firstName', 'object'],
required: ['id', 'firstName', 'object', 'any'],
type: 'object',
},
})
Expand Down
1 change: 1 addition & 0 deletions src/defaultConverters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit ba53205

Please sign in to comment.