oferei / json-gate

A friendly, fast JSON schema validator
MIT License
100 stars 16 forks source link

Remove the restriction on schema type. #15

Closed NicolasPelletier closed 11 years ago

NicolasPelletier commented 11 years ago

This follows discussion #12.

The validation of the schema itself restricted the type of the root object of the schema to an 'object' or an 'array'. This means that the following schema would be rejected:

  {
    type: 'null',
    description: 'Nothing is returned.'
  }

This fix removes this limitation.

Also updated the test suite following the change in requirement for the root type of a schema.

(Also added a semi-colon missing at the end of a line...)