Closed roszakg closed 7 months ago
I'm not sure if that is a bug or expected behavior, but for the following schema:
{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "/test_schema", "type": "object", "properties": { "One": { "type": "string" }, "Two" : { "type": "string" } }, "oneOf" : [ { "required" : ["One"] }, { "required" : ["Two"] } ], "unevaluatedProperties" : false }
the validation correctly fails when checked with the following JSON file:
{ "One" : "test", "Two" : "test" }
However the error message itself does not seem right: "No schema matched, but exactly one of them is required to match"
"No schema matched, but exactly one of them is required to match"
I was expecting something more in line with what https://www.jsonschemavalidator.net/ is returning:
"JSON is valid against more than one schema from 'oneOf'. Valid schema indexes: 0, 1."
Is that a bug?
What jsoncons library version?
Yes, "No schema matched" is wrong, we'll fix the message.
Fixed on master.
I'm not sure if that is a bug or expected behavior, but for the following schema:
the validation correctly fails when checked with the following JSON file:
However the error message itself does not seem right:
"No schema matched, but exactly one of them is required to match"
I was expecting something more in line with what https://www.jsonschemavalidator.net/ is returning:
"JSON is valid against more than one schema from 'oneOf'. Valid schema indexes: 0, 1."
Is that a bug?
What jsoncons library version?