-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't workingmodelserverEMF.cloud Model ServerEMF.cloud Model Serverv2
Description
Empty arrays are handled differently in EMF and Json. For example, these 2 models are equivalent in EMF (because lists are never "null"; they default to an empty collection), but different in Json:
{
"array": []
}{
}In the first case, we can add an array value with this patch:
{
"op": "add",
"path": "/array/-",
"value": "newValue"
}In the second case, we need to add the entire array to the root node:
{
"op": "add",
"path": "/array",
"value": ["newValue"]
}The JsonPatchHelper doesn't support the latter case (index-less "add" operation with a full array value). We should support direct feature edition (/array instead of /array/-) for arrays , and expect an array value in that case ([value1, value2] instead of value1).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmodelserverEMF.cloud Model ServerEMF.cloud Model Serverv2