ts-json-schema-generator
ts-json-schema-generator copied to clipboard
Support boolean schemas
As mentioned in #1152 , a schema may be a plain boolean instead of an object, where true means "Always passes validation" and false means "Always fails validation".
Currently, ts-json-schema-generator uses the type JSONSchema7 to represent a schema definition, but the type it should be using is JSONSchema7Definition since the latter also supports boolean schemas.
Boolean schemas can be represented with alternatives ( {} and { "not": {} } respectively), but the spec recommends to use boolean schemas over these forms, as it makes the intent more clear.
Happy to review a pull request towards this goal.