boolean

The boolean type matches only two special values: true and false. Note that values that evaluate to true or false, such as 1 and 0, are not accepted by the schema.

Language-specific info:
Python
Ruby

In Python, "boolean" is analogous to bool. Note that in JSON, true and false are lower case, whereas in Python they are capitalized (True and False).

schema
1
{ "type": "boolean" }
data
1
true
compliant to schema
data
1
false
compliant to schema
data
1
"true"
not compliant to schema

Values that evaluate to true or false are still not accepted by the schema:

data
1
0
not compliant to schema
color openjs foundation logo

Copyright OpenJS Foundation and JSON Schema contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.

The OpenJS Foundation | Terms of Use | Privacy Policy | Bylaws | Code of Conduct | Trademark Policy | Trademark List | Cookie Policy

© Copyright JSON Schema Organisation 2023