Attribute 'text ... as ...' for JSON
Submitted by Botond Baranyi
Link to original bug (#540262)
Description
Implement the XML attribute 'text ... as ...' for JSON, too.
For example:
type enumerated EnumNumber { One, Two, Three } with { variant "text 'One' as '1'"; variant "text 'Two' as '2'"; variant "text 'Three' as '3'"; } type record of EnumNumber EnumNumberList;
const EnumNumberList c_numbers := { One, Two, Three }; // is encoded into: [ "1", "2", "3" ]
Limitations compared to the XML version:
- 'text all as ...' doesn't work, only individual enum values can be changed;
- the XML-specific keywords (such as 'uncapitalized', etc.) also don't work, the new text must always be specified.
Version: 6.4.0