sbcgua / ajson

Yet another json parser serializer for ABAP
MIT License
52 stars 16 forks source link

Fix index when inserting a structure into an array #25

Closed mbtools closed 4 years ago

mbtools commented 4 years ago

When inserting a structure inside an array, the index for 'object' should be zero. See test case

Without the fix you get

/issues/1/       |end      |object |                        |1|2
/issues/2/       |end      |object |                        |2|2

But it should be

/issues/1/       |end      |object |                        |0|2
/issues/2/       |end      |object |                        |0|2
sbcgua commented 4 years ago

Good catch. Thanks !

P.S. jumping between languages with scoped variables (js) and abap is a source of bugs ... :) P.P.S probably this method need better variable naming ...