23
Views
1
Comments
[ardoJSON] OutSystems2JSON anonymous structure bug (fix attached)
Question
ardojson
Service icon
Forge asset by João Barata
Application Type
Service

There is currently a bug in the latest version of ardoJSON (v1.10.10) in which the OutSystems2JSON Action does not serialize anonymous structures correctly.


Example:


After assigning "FooBar" to MyStructure.AnonymousStructure.Text and appending "FooBar" to MyStructure.AnonymousStructureList, this is the output:

{"AnonymousStructure":{},"AnonymousStructureList":[{}]}


After troubleshooting the .NET code, I found that the writeRecord method is incorrectly redefining the leClass variable while parsing the attributes of anonymous structures, which are derived from ValueType type. Adding the following to this 'if' fixes it.


Here's the new output after this fix:

{"AnonymousStructure":{"Text":"FooBar"},"AnonymousStructureList":[{"Text":"FooBar"}]}


I've attached a sample module that reproduces the issue, as well as the fixed XIF. Would appreciate considering publishing a patch with this fix.


Thanks.

ardoJSONAnonymousRecordSample.oml
ardoJSON_AnonymousStructureFix.xif
2020-10-08 19-51-35
João Barata
Staff

Hi @Caio Santana Magalhães ,

Thank you for reporting the issue and providing the solution.

I've just released version 1.11.0 which should fix this issue.

Regards,


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.