not : Schema



An instance is valid against this keyword if it fails to validate successfully against the schema defined by this keyword.

Kind Applicator
Applies To Any
Dialect 2020-12
Introduced In Draft 4
Vocabulary Applicator
Also see

The not keyword is used to declare that an instance only validates if it doesn’t validate against the given subschema. It is essentially a way to define a rule that an instance should not match.

  • The value of this keyword must be a valid JSON Schema.
  • The boolean false schema, can be thought as an alias to { not: {} }.

Annotations are dropped when an instance fails. Therefore, in the case of not, annotations are always dropped because:

  1. If the subschema of not passes (producing annotations), then not itself fails, resulting in the annotations being dropped.
  2. If the subschema of not fails, no annotations are produced, and there is nothing for not to pass on.


Schema with 'not' keyword Schema
  "$schema": "",
  "not": {
    "type": "string"
An instance with values other than string is valid Instance
An instance with a string value is invalid Instance
Schema with 'not' set to false Schema
  "$schema": "",
  "not": false
Any instance is valid against the above schema Instance
{ "foo": "bar" }
  • Since the boolean false schema is equivalent to { "not": {} }, the overall schema translates to { "not": { "not": {} } }, which is equivalent to an empty object schema ({}). Therefore, every instance passes against the above schema.