We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I found a commit changing the result of "oneOf" validation.
commit 338d8defdb79eeff5f9801bd443ef9a4ae5bb8e7 Author: Steve Hanson <[email protected]> Date: Thu Jun 17 08:58:37 2021 +0100 initial
I try to parse invalid json with the following schema:
{ "oneOf": [ { "type": "integer" }, { "type": "number" }, { "type": "string", "pattern": "^z" } ] }
Before the commit, the validator output is:
{"oneOf":{"errors":[{},{},{"type":{"expected":["string"],"actual":"integer","errorCode":20,"instanceRef":"#","schemaRef":"#/oneOf/2"}}],"errorCode":22,"instanceRef":"#","schemaRef":"#"}}
but after:
{"oneOf":{"matches":[0,1],"errorCode":22,"instanceRef":"#","schemaRef":"#"}}
However, I see the documentation says:
allOf, anyOf, and oneOf errors: required array of at least one object.
errors
So, either it is a mistake in the documentation or the code. But what is the correct one?
Snippet to reproduce:
using namespace rapidjson; Document sd; sd.Parse(schema_str); auto const schema = SchemaDocument{sd}; Document d; d.Parse("1"); // invalid json SchemaValidator validator{schema}; if (!d.Accept(validator)) { MemoryPoolAllocator<> allocator; auto ret = Value(validator.GetError(), allocator); StringBuffer sb; Writer<StringBuffer> w{sb}; ret.Accept(w); std::cout << sb.GetString(); } else { std::cout << "no error"; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I found a commit changing the result of "oneOf" validation.
I try to parse invalid json with the following schema:
Before the commit, the validator output is:
but after:
However, I see the documentation says:
So, either it is a mistake in the documentation or the code. But what is the correct one?
Snippet to reproduce:
The text was updated successfully, but these errors were encountered: