Skip to content

New decorators @Custom and @Transform #386

Open
@hsvtslv

Description

@hsvtslv

Of course, I read how to create my own validation rules. But I am very lazy to do this, so now I use something like..

@ValidateIf(that => that.password !== that.passwordConfirmation)
@Length(1, 0, { message: 'password !== passwordConfirmation' })

It would be nice to have custom decorator

@Custom(that => that.password !== that.passwordConfirmation, { messages: ''})

And, of course, transform value before validation

@Transform(value => parseInt(value))

And, what about moving default messages to a JSON file? Now it is very difficult to localize it. Any plans for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions