Description
Since the 0.12.x update, the names of the decorators are lost when stored.
For example, when the IsString decorator is used, the metadata store a new entry with the type customValidation instead of isString. This seems to apply to all decorators, because of this line:
|
type: options.name && ValidationTypes.isValid(options.name) ? options.name : ValidationTypes.CUSTOM_VALIDATION, |
.
Reproduction
Inspect the stored metadata with getMetadataStorage().getTargetValidationMetadatas and you'll see that all entries' types are customValidation, instead of their decorator names.
Environment
class-validator version: 0.12.2
Description
Since the 0.12.x update, the names of the decorators are lost when stored.
For example, when the
IsStringdecorator is used, the metadata store a new entry with the typecustomValidationinstead ofisString. This seems to apply to all decorators, because of this line:class-validator/src/register-decorator.ts
Line 80 in 1955250
Reproduction
Inspect the stored metadata with
getMetadataStorage().getTargetValidationMetadatasand you'll see that all entries'types arecustomValidation, instead of their decorator names.Environment
class-validator version:
0.12.2