For boolean properties, I believe this keyword is being misinterpreted. It appears that angular-schema-form is interpreting "required" to mean "The user must check this box". Or, in other words "required" is being interpreted to mean "This property must have the value 'true'".
This can be seen on the schemaform demo site: http://schemaform.io/examples/bootstrap-example.html
1) Select the "Kitchen Sink" option
2) In the schema section, add "soul" to the "required" array.
3) Go to the "generated form" section, and uncheck the "Terms of Service" checkbox.
4) Click the "Do It" button
You will see "Form is not valid", and you will see that the "Terms of Service" widget gets a red "required" warning.
It seems as if angular-schema-form is imposing its own meaning onto the "required" keyword for boolean properties. This seemingly makes it impossible to define a schema that says "the object instance must contain this field, but it can be either true or false".
The JSON Schema spec says this about the "required" keyword:
In other words, marking a property as "required" is supposed to mean "This property must not be omitted from the object instance".
See http://json-schema.org/latest/json-schema-validation.html#rfc.section.6.17
For boolean properties, I believe this keyword is being misinterpreted. It appears that angular-schema-form is interpreting "required" to mean "The user must check this box". Or, in other words "required" is being interpreted to mean "This property must have the value 'true'".
This can be seen on the schemaform demo site: http://schemaform.io/examples/bootstrap-example.html 1) Select the "Kitchen Sink" option 2) In the schema section, add "soul" to the "required" array. 3) Go to the "generated form" section, and uncheck the "Terms of Service" checkbox. 4) Click the "Do It" button
You will see "Form is not valid", and you will see that the "Terms of Service" widget gets a red "required" warning.
It seems as if angular-schema-form is imposing its own meaning onto the "required" keyword for boolean properties. This seemingly makes it impossible to define a schema that says "the object instance must contain this field, but it can be either true or false".