octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #60688] jsondecode does not handle some arrays


From: anonymous
Subject: [Octave-bug-tracker] [bug #60688] jsondecode does not handle some arrays of structs correctly
Date: Tue, 17 Aug 2021 03:39:14 -0400 (EDT)
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15

Follow-up Comment #4, bug #60688 (project octave):

I've also run into this issue recently. Attached a patch that fixes it.

Essentially `decode_array_of_arrays` didn't handle the cases very well where
the "array in the array turned out to actually be a struct array".
I've also added a test case for 2D struct arrays which would fail without the
patch.


assert (jsondecode ('[[{"foo": 42}, {"foo": 1.23}], [{"foo": 12}, {"foo":
"bar"}]]'), struct("foo", {42 1.23; 12 "bar"}));






(file #51792)
    _______________________________________________________

Additional Item Attachment:

File name: fix_60688.patch                Size:6 KB
    <https://file.savannah.gnu.org/file/fix_60688.patch?file_id=51792>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60688>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]