Numeric enumerations should use AllowedValues

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major
    • V4.01_WD01
    • Affects Version/s: V4.0_ERRATA03
    • Component/s: CSDL JSON, CSDL XML, JSON Format
    • None
    • Environment:

      Proposed

    • Hide

      Leave enumeration types as they are. If no flags or synonyms/symbolic names are required/desired, use annotation Validation.AllowedValues instead.

      Call out that services that want a discrete set of numeric should use AllowedValues.

      Show
      Leave enumeration types as they are. If no flags or synonyms/symbolic names are required/desired, use annotation Validation.AllowedValues instead. Call out that services that want a discrete set of numeric should use AllowedValues.

      Part 3: CSDL states that enumeration values are sorted and compared using their numeric value because it allows synonym symbolic names with the same numeric value.

      Part 3: CSDL also only allows symbolic values in annotations.

      JSON Format on the other hand states that the symbolic name, represented as a string, is preferred.

      This makes life unnecessarily complicated for clients to evaluate conditional annotation expressions based on enums as they can't compare enum values in annotations and payloads without internally translating them into numeric values, which they can only know after reading vocabulary files.

            Assignee:
            Unassigned
            Reporter:
            handl
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: