Open edgarmueller opened 5 years ago
Are there any updates on this issue? Have a hacky workaround going but it's not ideal. I see there is a solution ready in your PRs!
@mlandry8 Except the open draft PR there isn't unfortunately, we simply didn't find the time to finish it. But we'll try to do so for the next minor release (which would be 2.4.0). If you already have something and you think it's a valuable addition to the framework, we always welcome contributions! Maybe you could compare it to the existing PR and check which approach would be better.
I am stuck with this problem, too. How could I work around this problem until it is fixed in the next milestone? @mlandry8 You mentioned a hacky workaround - could you give a hint on how to do it? Thanks!
Update: While JSON Forms does not support async validation directly, there is a straightforward workaround by managing the errors outside of JSON Forms:
validationMode="NoValidation"
to turn off the built-in validationcreateAjv()
exported by @jsonforms/core
const validator = myAjv.compile(schema)
(this is costly, so the validator should be memoized to not compile the schema again with every change)additionalProps={myErrors}
Describe the bug If ajv is configured to use asynchronous validation, error reporting is not working correctly, see https://github.com/epoberezkin/ajv#asynchronous-validation for more info.
To Reproduce Use any example with $async set
Expected behavior Error reporting should not break.