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
What version of Ajv are you using? Does the issue happen if you use the latest version?
Using version 8.12.0 up to 8.16.0 works, latest version fails.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at Object.urnSerialize [as serialize] (ajv_dist_2020.js?v=7ea982fe:3411:37)
at Object.serialize (ajv_dist_2020.js?v=7ea982fe:3592:67)
at _getFullPath (ajv_dist_2020.js?v=7ea982fe:2215:35)
at getFullPath (ajv_dist_2020.js?v=7ea982fe:2211:14)
at Ajv2020.getSchemaRefs (ajv_dist_2020.js?v=7ea982fe:2236:26)
at Ajv2020._addSchema (ajv_dist_2020.js?v=7ea982fe:4195:51)
at Ajv2020.addSchema (ajv_dist_2020.js?v=7ea982fe:3993:34)
at Ajv2020.addInitialSchemas (ajv_dist_2020.js?v=7ea982fe:4253:16)
at new Ajv (ajv_dist_2020.js?v=7ea982fe:3887:27)
at new Ajv2020 (ajv_dist_2020.js?v=7ea982fe:6903:9)
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:pyramidsolutions.com/schemas/iw/rule/column/adorner",
"type": "object",
"description": "Adorner rule",
"properties": {
"name": {
"type": "string",
"description": "Name of rule used in diagnostics"
},
"type": {
"type": "string",
"description": "Type of rule 'adorner'",
"const": "adorner"
},
"enabled": {
"type": "boolean",
"description": "Evaluate rule if set to true"
},
"field": {
"type": "string",
"description": "Field name to evaluate"
},
"position": {
"type": "string",
"description": "Adorner position",
"enum": ["before", "after"]
},
"function": {
"type": "string",
"description": "Javascript must return formatting object(s) to trigger"
},
"template": {
"type": ["number", "integer", "boolean", "string", "array", "object"],
"description": "Data passed to the script function"
}
},
"required": ["name", "type", "enabled", "field", "position", "function"]
}
Not sure if it is relevant. All JSON schemas use similar techniques for $schema and $id.
Sample data
Crashes in constructor before any methods can be called.
Your code
constajv=newAjv2020(options);
Crashes in constructor.
Validation result, data AFTER validation, error messages
Crashes before any methods can be called.
What results did you expect?
Expect it to work the same as previous version. Expect you to check values for null or undefined before calling methods on them.
Are you going to resolve the issue?
No.
The text was updated successfully, but these errors were encountered:
After some reading, went in and added the nid to the urn values; according to spec this field is required, but earlier versions of the library tolerated it being omitted. This tolerance should be preserved to avoid unexpected issues for users upgrading the version of this package, perhaps add an option setting to opt-in to the stricter behavior.
In any event there should be checks in place for null and undefined values; this is just good hygiene.
If the nid field is really required by the implementation, a specific actionable error message should be provided, not one from an indirect "crash". This would save time on troubleshooting by users.
What version of Ajv are you using? Does the issue happen if you use the latest version?
Using version
8.12.0
up to8.16.0
works, latest version fails.Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at Object.urnSerialize [as serialize] (ajv_dist_2020.js?v=7ea982fe:3411:37)
at Object.serialize (ajv_dist_2020.js?v=7ea982fe:3592:67)
at _getFullPath (ajv_dist_2020.js?v=7ea982fe:2215:35)
at getFullPath (ajv_dist_2020.js?v=7ea982fe:2211:14)
at Ajv2020.getSchemaRefs (ajv_dist_2020.js?v=7ea982fe:2236:26)
at Ajv2020._addSchema (ajv_dist_2020.js?v=7ea982fe:4195:51)
at Ajv2020.addSchema (ajv_dist_2020.js?v=7ea982fe:3993:34)
at Ajv2020.addInitialSchemas (ajv_dist_2020.js?v=7ea982fe:4253:16)
at new Ajv (ajv_dist_2020.js?v=7ea982fe:3887:27)
at new Ajv2020 (ajv_dist_2020.js?v=7ea982fe:6903:9)
That is this line of code:
Not sure what
nid
is, but it'sundefined
and the code does not validate, hence the unexpected exception. Previous versions did not calltoLowerCase
.Ajv options object
JSON Schema
Not sure if it is relevant. All JSON schemas use similar techniques for
$schema
and$id
.Sample data
Crashes in constructor before any methods can be called.
Your code
Crashes in constructor.
Validation result, data AFTER validation, error messages
Crashes before any methods can be called.
What results did you expect?
Expect it to work the same as previous version. Expect you to check values for
null
orundefined
before calling methods on them.Are you going to resolve the issue?
No.
The text was updated successfully, but these errors were encountered: