enjoi icon indicating copy to clipboard operation
enjoi copied to clipboard

feature: allow unique keys on array schema

Open ederEnriquez opened this issue 4 years ago • 1 comments

1 Uniques by key

Example: I have an array of objects and need uniques elements by "key1", "key2", "key3"

Schema should have {type:"array", uniques:[ "key1", "key2", "key3"]}

Valid schema

[
{key1: "200-300", key2: "wishlist_1", key3: "bid1.", indicator: true},
{key1: "200-300", key2: "wishlist_2", key3: "bid1.", indicator: false},
{key1: "200-300", key2: "wishlist_3", key3: "bid1.", indicator: true},
]

Invalid schema. Has duplicates values for keys ("key1", "key2", "key3")

[
{key1: "200-300", key2: "wishlist_1", key3: "bid1.", indicator: true},
{key1: "200-300", key2: "wishlist_1", key3: "bid1.", indicator: false},
{key1: "200-300", key2: "wishlist_3", key3: "bid1.", indicator: true},
]

2 Add label by description

3 Add greater and less using Joi reference

ederEnriquez avatar Jul 02 '20 06:07 ederEnriquez

Is this valid JSON schema? Can you point to the spec? I couldn't find it.

tlivings avatar Jul 03 '20 13:07 tlivings