Closed bruceferguson2 closed 4 months ago
JSON Schema can only deal with data that can ultimately be serialised as a JSON string. Functions cannot be represented in JSON so you won't be able to use a function like log
as a default, nor as a value within JSON. For example, try JSON.stringify({func: console.log})
and you'll see it doesn't work.
What version of Ajv are you using? Does the issue happen if you use the latest version?
8.16.0
Ajv options object
JSON Schema
Sample data
Your code
Validation result, data AFTER validation, error messages
What results did you expect?
That "console.log" would be used as the default value.
Are you going to resolve the issue?