Hello Benjamin,
1/
The fglcomp compiler considers ATTRIBUTE and ATTRIBUTES as synonyms (I would say for backward compatibility)
We have only documented the second keyword, because you can specify multiple attributeS in this clause.
If some consider that we should document both keywords, the syntax diagram would look like this:
ATTRIBUTE[S] ( attribute [ = "value" ] [,...] )
or
{ATTRIBUTE|ATTRIBUTES} ( attribute [ = "value" ] [,...] )
instead of current simple diagram:
ATTRIBUTES ( attribute [ = "value" ] [,...] )
https://4js.com/online_documentation/fjs-fgl-manual-html/#fgl-topics/c_fgl_variables_attributes.htmlIf we document both, programmers will tend to use sometimes ATTRIBUTE and sometime ATTRIBUTES, with the risk to miss one or the other when searching in your code ( vim ctrl-* )
Return to simplicity.
2/
In JSON, array
elements have no name.
Try to put the ATTRIBUTES() clause just after DYNAMIC ARRAY:
DEFINE jdb RECORD ATTRIBUTES(json_name="database")
rec_tlsbonret DYNAMIC ARRAY ATTRIBUTES(json_name="tlsbonret_2") OF t_tlsbonret
,rec_tlsclidis DYNAMIC ARRAY ATTRIBUTES(json_name="tlsclidis_2") OF t_tlsclidis
END RECORD
output (with my own t_tlsbonret and t_tlsclidis types):
{
"tlsbonret_2": [
{
"field11": 9991
}
],
"tlsclidis_2": [
{
"field21": 9992
}
]
}
Seb