You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Validation result, data AFTER validation, error messages:
TypeError: id.replace is not a function
at Function.normalizeId (/XXXX/node_modules/ajv/lib/compile/resolve.js:216:18)
at _addSchema (/XXXX/node_modules/ajv/lib/ajv.js:282:22)
at Ajv.validate (/XXXX/node_modules/ajv/lib/ajv.js:94:23)
Currently using integer ids in my project. As you can see, ajv is failing because there is no replace function on the integer type in Javascript.
The text was updated successfully, but these errors were encountered:
@scott-martin please check docs - there are 3 suggested options in Getting started, you are not using it correctly. ajv.validate expects a schema as the first parameter.
epoberezkin
changed the title
normalizeId fails when id is not stringnormalizeId fails when id is not string - improve error reporting
Dec 24, 2016
epoberezkin
changed the title
normalizeId fails when id is not string - improve error reportingnormalizeId fails when id is not string (invalid schema) - improve error reporting
Dec 24, 2016
epoberezkin
changed the title
normalizeId fails when id is not string (invalid schema) - improve error reporting
fails when id in schema is not a string (invalid schema) - improve error reporting
Dec 24, 2016
What version of Ajv are you using? Does the issue happen if you use the latest version?
4.10.2
JSON Schema (please make it as small as possible to reproduce the issue):
Data (please make it as small as posssible to reproduce the issue):
Your code (please use
options
,schema
anddata
as variables):Validation result, data AFTER validation, error messages:
Currently using integer ids in my project. As you can see, ajv is failing because there is no
replace
function on the integer type in Javascript.The text was updated successfully, but these errors were encountered: