When I call JSON::Validator.validate! with this object as the schema and pass in the output of my app, it fails saying:
JSON::Schema::ValidationError: The property '#/' of type Hash matched more than one of the required schemas in schema 11fae3df-6a4c-5dce-bd06-02c5497c9b88
Calling JSON::Validator.validate with the same arguments returns false.
The output being tested is:
{"city":"Orlando","state":"FL"}
Expected Behavior
The object being tested should pass validation when checked against the given schema, since it clearly matches one but not both of the possible schemas.
Current Behavior
When I call JSON::Validator.validate! with the data described above, the output indicates the JSON Schema gem thinks it matches both of the possible schemas. When I call JSON::Validator.validate with the same data, the result is false.
Steps to Reproduce (for bugs)
In IRB, using the schema and output given above, call JSON::Validator.validate!(schema, object). Observe it fails.
My Environment
Version used: 2.6.2
Operating System and version: OS X El Capitan 10.11.5
Summary
I am writing a JSON generator and am testing it with the following schema:
When I call
JSON::Validator.validate!
with this object as the schema and pass in the output of my app, it fails saying:Calling
JSON::Validator.validate
with the same arguments returnsfalse
.The output being tested is:
Expected Behavior
The object being tested should pass validation when checked against the given schema, since it clearly matches one but not both of the possible schemas.
Current Behavior
When I call
JSON::Validator.validate!
with the data described above, the output indicates the JSON Schema gem thinks it matches both of the possible schemas. When I callJSON::Validator.validate
with the same data, the result isfalse
.Steps to Reproduce (for bugs)
In IRB, using the schema and output given above, call
JSON::Validator.validate!(schema, object)
. Observe it fails.My Environment