The IETF spec says that "The names within an object SHOULD be unique." However, I can't figure out how to actually generate this constraint in a schema.
2.2. Objects
An object structure is represented as a pair of curly brackets
surrounding zero or more name/value pairs (or members). A name is a
string. A single colon comes after each name, separating the name
from the value. A single comma separates a value from a following
name. The names within an object SHOULD be unique.
Given a document like below, I can construct a schema that validates that each instance of 'foo' is valid, but I've unable to determine how to reject duplicates. I'd prefer to not wrap items in an array to gain access to the 'uniqueItems' keyword.
{
"foo" : { /* some object */ },
"foo" : { /* some object */ },
"bar" : { /* some object */ }
}
Appreciate any insights.
Thanks,
-Josh