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
Problem: async custom format validator does not get called in oneOf.
Sample test:
"use strict"; module.exports = { description: "async validators do not work inside oneOf", async: true, options: { asyncTimeout: 2000 }, setup: function(validator, Class) { // asynchronous validator Class.registerFormat("string-length", function(str, callback) { setTimeout(function() { callback(str.length > 10); }, 1); }); // same as above but synchronous (comment out the validator above and try with this instead) // Class.registerFormat("string-length", function(str) { // return str.length > 10; // }); }, schema: { // try removing the oneOf, starts working (allOf also works) oneOf: [ { type: "string", format: "string-length" } ] // just these without oneOf work // type: "string", // format: "string-length" }, tests: [ { description: "should pass custom format as string length is greater than 10", data: "123456789012345", valid: true }, { description: "should fail custom format as string length is lower than 10", data: "12345", valid: false } ] };
The text was updated successfully, but these errors were encountered:
Created test case for issue zaggino#207
aa93895
No branches or pull requests
Problem:
async custom format validator does not get called in oneOf.
Sample test:
The text was updated successfully, but these errors were encountered: