Skip to content

The names of the decorators are lost in the MetadataStorage #622

@CyriacBr

Description

@CyriacBr

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

  • nodejs: 10.18.1
  • browser: no
  • framework/library: standalone

class-validator version: 0.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: highstatus: done/releasedIssue has been completed, no further action is needed.type: fixIssues describing a broken feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions