Closed albertmink closed 9 months ago
looks like a bug in touch_array
which inserts at the top (pos 0). does the following work for you?
method zif_ajson~touch_array.
...
if ms_opts-keep_item_order = abap_true.
if ls_deleted_node is not initial.
ls_new_node-order = ls_deleted_node-order.
else.
ls_new_node-order = lr_parent->children.
endif.
endif.
...
endmethod.
Hmm, I would actually expect:
{
"descriptions": {
"methods": [
{ "name": "METH1", "description": "Sonne"},
{ "name": "METH1", "parameters":[ { "name": "param2", "description": "Parameter B"} ]}
]
}
}
Because the arrays have no keys
@mbtools Marc what do you think ? If I remember well you contributed the merge
, what was the initial design
"name": "METH1" already exists so it adds to it. it just needs the fix to put it into the correct position (at the end with keep order)
OK, no strong opinion on this. PR would be welcomed!
Kind of resorting for example
Produces
where I hoped to get
I know, ordering does not mean much to JSON data. But can AJSON merge the both objects respecting the order?