Skip to content

Lost key after validation on assert #569

@sarhugo

Description

@sarhugo

Hi, I come from hapijs/hapi#2431
Please check https://gist.github.com/sarhugo/6ec6929a98697cfd8a1a
The problem that I'm having is that using route validation on Hapi I'm not having a way to get the object key for a failed assert validation.
I'm aware of the label() method to override the key returned on error but if I make multiple assert validations then the label becomes generic as "value".
Maybe adding some options argument to assert so I can indicate the key returned for each validation?
Here I made another gist to reproduce using only Joi
https://gist.github.com/sarhugo/2b47490ae615a9da9a36

Regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug or defect

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions