Skip to content

json-schema 2.0.1 broke schema validation #58

Closed
@dazza-codes

Description

The full validation broke with v2.0.1 when it was fine with v2.0.0, for example:

### BEGIN JSON SCHEMA RUBY CODE
 PAGE_SCHEMA = <<-END_SCHEMA
  {
    "type": "object",
    "title": "page",
    "description": "A Resource Index page of results.",
    "additionalProperties": false,
    "properties": {
      "page": { "type": "number", "required": true },
      "pageCount": { "type": "number", "required": true },
      "prevPage": { "type": ["number","null"], "required": true },
      "nextPage": { "type": ["number","null"], "required": true },
      "links": { "type": "object", "required": true },
      "collection": { "type": "array", "required": true }
    }
  }
  END_SCHEMA
### END JSON SCHEMA RUBY CODE

The validation error reads: "JSON::Schema::ValidationError: The property '#/properties/page/required' of type TrueClass did not match the following type: array in schema http://json-schema.org/draft-04/schema#"

This can't be right for a "required" property, surely?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions