Closed MiguelSavignano closed 12 months ago
user.json
{ "type": "object", "required": ["user"], "properties": { "user": { "allOf": [ { "type": "object", "properties": { "name": { "type": "string" } } }, { "type": "object", "properties": { "age": { "type": "integer" } } } ] } } }
Example:
require "json-schema" JSON::Validator.validate!("./user.json", user: { name: "Jhon", age: "1" })
Should raise an exception because the age is not an integer, but the current message is:
The property '#/user' of type object did not match all of the required schemas (JSON::Schema::ValidationError)
and should be an explicit messages like:
The property '#/user/age' of type string did not match the following type: integer (JSON::Schema::ValidationError)
@MiguelSavignano I have tried addressing this above issue in this PR https://github.com/voxpupuli/json-schema/pull/495 Could you please check and help me get it merged.
user.json
Example:
Should raise an exception because the age is not an integer, but the current message is:
and should be an explicit messages like: