Here is a JSON schema that uses propertyNames:
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"propertyNames": {"enum": ["num", "name"]}
}
I "think" the meaning of that schema is this: A conforming JSON instance must be an object and the object must contain a "num" property and a "name" property; the value of the two properties is unspecified. Is that correct, is that what the schema means?
I created this instance:
{
"num": 10
}
I validated that instance against the schema and the validator says it is valid. Hmm, why? Doesn't the schema specify that the object must contain both "num" and "name"?