Is "type" a required keyword? If not, how should validation be handled when a type is not specified? #172
Description
According to json-schema.org:
When the primitive type of the instance cannot be validated by a given keyword, validation for this keyword and instance SHOULD succeed.
However, it is unclear whether the "primitive type" refers to the instance itself, or to the schema's type
keyword. If the latter, how should an instance be validated if the schema is missing a type
keyword for the instance? For example, if an instance is validated against a schema containing simply { required: ["a", "b"] }
, should it be inferred that the schema describes an object, and thus validation should fail if the instance is, say, an integer? If so, what about if the schema also has non-object keywords, like minimum
?
IMHO, a schema missing a type
keyword should be considered invalid, as that makes validation of an instance impossible. And as a result, any instance validated against it should succeed.