Error when deleting required objects/arrays #142
Replies: 3 comments
-
Thanks for pointing these out, it seems like a bit of a bug. I'll look into it very soon. Thanks for providing very specific examples. |
Beta Was this translation helpful? Give feedback.
-
Moved to issue #143 |
Beta Was this translation helpful? Give feedback.
-
Hi @laurajinks, this should be fixed now in v1.19.1, please let me know if it works for you now.
I think this is also fixed now -- unless I'm missing what you're saying? |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to implement an editor with validation using ajv as outlined in the demos. I have it working properly when validating editing or deleting individual required values, but I'm getting an error when deleting required objects or arrays. It seems to stem from this line here https://github.com/CarlosNZ/json-edit-react/blob/main/src/CollectionNode.tsx#L196
For example, if I had a JSON object like:
and
bar
was a required field, I am seeing the error messaging correctly. However iffoo
is a required field and I attempt to delete it, I am getting this error:Additionally, this is less of a big deal, but if I edit the key
foo
and it fails validation, It correctly does not persist the edit, however it does not show an inline error message like it does when incorrectly editing a string value.Any thoughts on something I could be missing here?
Beta Was this translation helpful? Give feedback.
All reactions