Extend JSON 'as value' attribute for records/sets with one field and for the anytype
Submitted by Botond Baranyi
Assigned to Botond Baranyi
Link to original bug (#515449)
Description
Values of the anytype should be encodable as a JSON value (without the name of the selected field and without the braces). This can be done through the JSON attribute 'as value'. Since the anytype cannot have variant attributes, this could only be done through subtyping (by creating a type alias for the anytype or by using it as a field or element of a structure).
Currently the JSON codec only takes the variant attributes of base types into account when coding (subtypes are only considered for records, sets, record ofs, set ofs in runtime 2). This needs to be extended, at least for the 'as value' attribute.
The 'as value' attribute should also work on records and sets with one field. In this case the record's/set's encoding should be equal to the field's encoding (the field name and the braces should be omitted).
Version: 6.1.0