ostrowr / ts-json-validator

Let JSON play nicely with Typescript
MIT License
342 stars 7 forks source link

Booleans are valid JSON schemas #5

Closed ostrowr closed 4 years ago

ostrowr commented 4 years ago

Right now, true and false are not supported as JSON schemas, though they are useful in some places.

For example, the additionalItems field in an array can take a boolean with meaning, as can the additionalProperties field in an object. These shouldn't need to be special-cased – true is just a schema that always validates, and false always doesn't.