-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.01_CS01
-
Fix Version/s: V4.01_CS02
-
Component/s: CSDL JSON
-
Labels:None
-
Environment:
Applied
-
Proposal:
-
Resolution:
The XML representation of <EnumMember> constant expressions contains the enumeration type name of the enumeration value as a prefix:
<Annotation Term="Namespace1_Alias.TermEnum"> <EnumMember>Namespace1_Alias.ENString/String1 Namespace1_Alias.ENString/String3</EnumMember> </Annotation>
The JSON representation does not contain the type name:
"@com.odata.v4.technical.scenario.TermEnum": "String1,String3"
This breaks isomorphy between XML and JSON representation of CSDL.
The JSON representation was explicitly chosen without type prefix to mirror the JSON Format representation of enumeration values in data payloads.
Allowing an @odata.type control information would both be consistent with JSON Format and establish isomorphy to CSDL XML:
"@com.odata.v4.technical.scenario.TermEnum@odata.type": "#Namespace1_Alias.ENString", "@com.odata.v4.technical.scenario.TermEnum": "String1,String3"
This should be optional in the normal case, required if you can't deduce the type; (i.e., if the term cannot be resolved for some reason or the type of the term is Edm.Untyped), as in the data payload.