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
and its value hasn't been checked (for being undefined) before.
This is not only a potential bug. The function has actually been called without rootSchema in some places (e.g. in testers.js) and I especially encountered it after this:
But I think the more important issue here is why schema $refs should be resolved in testers many times? This would be a big performance issue! The schema can be parsed (resolved) one time and be used multiple times (in testers and probably any other places).
Yes the resolving is not in the best state at the moment in the alpha release. We will make sure that all basic resolving cases work before the stable release, see #1750 for more information.
Note that you can always resolve your JSON Schema yourself before handing it over to JSON Forms. I would like recommend json-refs for that, see https://jsonforms.io/docs/ref-resolving
Describe the bug
In
resolveSchema()
function:jsonforms/packages/core/src/util/resolvers.ts
Lines 156 to 162 in 81f1f19
rootSchema
incatch
block can beundefined
. This is an optional parameter ofresolveShcema()
:jsonforms/packages/core/src/util/resolvers.ts
Lines 110 to 114 in 81f1f19
and its value hasn't been checked (for being
undefined
) before.This is not only a potential bug. The function has actually been called without
rootSchema
in some places (e.g. intesters.js
) and I especially encountered it after this:jsonforms/packages/core/src/testers/testers.ts
Line 89 in 81f1f19
Expected behavior
Obviously, having no error.
But I think the more important issue here is why schema
$ref
s should be resolved in testers many times? This would be a big performance issue! The schema can be parsed (resolved) one time and be used multiple times (in testers and probably any other places).Steps to reproduce the issue
JSON-Schema
:UI-Schema
:false
Data
:Screenshots
Note: The above playground works with JsonForms v3.0.0-alpha.2
In which browser are you experiencing the issue?
Google Chrome v96.0.4664.93 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: