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
Given the following schema:
{ "type": "object", "definitions": { "type_1": { "type": "string", "pattern": "^[0-9]+$" }, "type_2": { "enum": ["blabla"] } }, "properties": { "someProperty": { "oneOf": [ { "$ref": "#/definitions/type_1" }, { "$ref": "#/definitions/type_2" } ] } } }
Validation fails when given an object that is valid for this schema. However, validation passes if the $refs are replaced with their actual schemas.
$ref
The text was updated successfully, but these errors were encountered:
Can't reproduce:
const schema1 = { "type": "object", "definitions": { "type_1": { "type": "string", "pattern": "^[0-9]+$" }, "type_2": { "enum": ["blabla"] } }, "properties": { "someProperty": { "oneOf": [ { "$ref": "#/definitions/type_1" }, { "$ref": "#/definitions/type_2" } ] } } } const v1 = validator(schema1) console.log(v1({ someProperty: 10 })) // false console.log(v1({ someProperty: "---" })) // false console.log(v1({ someProperty: "012345" })) // true console.log(v1({ someProperty: "blabla" })) // true console.log(v1({ someProperty: "blablabla" })) // false
Could you share a complete testcase and the version that you are using?
Sorry, something went wrong.
ChALkeR
No branches or pull requests
Given the following schema:
Validation fails when given an object that is valid for this schema.
However, validation passes if the
$ref
s are replaced with their actual schemas.The text was updated successfully, but these errors were encountered: