There was a similar discussion here
http://4js.com/support/forum/?topic=1186You have not mentioned the proposeType method so I will just make sure you are aware of it
http://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_ext_util_JSON_proposeType.htmlIf you have used it, you will notice that it would return ...
RECORD
errors RECORD
0 DYNAMIC ARRAY OF STRING
END RECORD,
success DYNAMIC ARRAY OF STRING
END RECORD
... which is not valid syntax. proposeType was added in 3.00, DICTIONARY was added in 3.10, wether proposeType will ever propose DICTIONARY is a valid question?
If you replace the 0 with DICTIONARY then you get a syntax error as DICTIONARY is expecting a data-type.
I then tried creating a type as in the code below ...
IMPORT util
MAIN
DEFINE s1, s2 STRING
TYPE errors_type DYNAMIC ARRAY OF STRING
DEFINE responseR RECORD
errors DICTIONARY OF errors_type,
success DYNAMIC ARRAY OF STRING
END RECORD
LET s1 = '{"errors":{},"success":["000014298"]}'
LET s2 = '{"errors":{"0":["identifier: Consignment with identifier already exists"]},"success":[]}'
DISPLAY util.JSON.proposeType(s1)
DISPLAY util.JSON.proposeType(s2)
CALL util.JSON.parse(s1,responseR)
DISPLAY responseR.success[1]
INITIALIZE responseR TO NULL
CALL util.JSON.parse(s2,responseR)
DISPLAY responseR.errors["0"][1]
END MAIN
... which seemed to work OK. So you could try that.
Two possible issues for us to look at ...
1. Does proposeType propose DICTIONARY? Should it in the case where the proposed record name (in this case "0") is not valid Genero syntax?
2. Should DICTIONARY OF DYNAMIC ARRAY OF ... be valid syntax?
Reuben