Skip to content

unique() does not allow nested duplication check of array of objects #208

@ujwal-setlur

Description

@ujwal-setlur

I have the same problem as in https://stackoverflow.com/questions/53243306/validating-unique-key-pairs-in-a-nested-object-with-joi-and-nodejs

I essentially have an array of objects, and I want to validate that a certain key/value pair is not duplicated amongst the array elements of objects.

This can be solved in joi with providing a comparator to the unique() function.

However, in joiful, I cannot pass a comparator to unique().

Is there a different way to do this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions