Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1111

Structural properties: default for $Nullable is false in CSDL JSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.01_CSD01
    • Fix Version/s: V4.01_CSD02
    • Component/s: CSDL JSON
    • Labels:
      None
    • Proposal:
      Hide

      Simplify the handling of null values in JSON by making $Nullable false the default value for all usages in JSON CSDL. Additionally, we clarify the meaning of $Nullable = true for a collection (that it allows null values within the collection) and disallow $Nullable=true for collection-valued navigation properties.

      Show
      Simplify the handling of null values in JSON by making $Nullable false the default value for all usages in JSON CSDL. Additionally, we clarify the meaning of $Nullable = true for a collection (that it allows null values within the collection) and disallow $Nullable=true for collection-valued navigation properties.
    • Resolution:
      Show
      https://www.oasis-open.org/committees/download.php/61609/odata-csdl-json-v4.01-wd02-2017-09-21.docx

      Description

      Section 7.2.1 incorrectly states that an omitted $Nullable member means "false". This is contrary to its CSDL XML default as well as the default for $Nullable for parameters, return types, and navigation properties.

      http://docs.oasis-open.org/odata/odata-csdl-json/v4.01/csprd01/odata-csdl-json-v4.01-csprd01.html#sec_Nullable

        Attachments

          Activity

          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Resolved as proposed 2017-9-14.

          Show
          mikep Michael Pizzo (Inactive) added a comment - Resolved as proposed 2017-9-14.
          Hide
          handl Ralf Handl added a comment - - edited

          Feedback from implementation teams:

          • different defaults depending on the representation format (XML versus JSON) is confusing
          • different default than SQL is confusing
          • unexpected for JavaScript programmers: every variable is nullable
          Show
          handl Ralf Handl added a comment - - edited Feedback from implementation teams: different defaults depending on the representation format (XML versus JSON) is confusing different default than SQL is confusing unexpected for JavaScript programmers: every variable is nullable
          Hide
          mikep Michael Pizzo (Inactive) added a comment -

          Further discussion:
          -$Nullable=false seems a more reasonable default in general
          -it's nice to be consistent with JSON
          -For the schemas we looked at, nullable=false is the more common case and results in fewer lines of code

          in 2017-9-21 meeting we agreed to retain this change in making $Nullable false in CSDL JSON, and opened ODATA-1115 to discuss similar changes to defaults for Precision and Scale.

          Show
          mikep Michael Pizzo (Inactive) added a comment - Further discussion: -$Nullable=false seems a more reasonable default in general -it's nice to be consistent with JSON -For the schemas we looked at, nullable=false is the more common case and results in fewer lines of code in 2017-9-21 meeting we agreed to retain this change in making $Nullable false in CSDL JSON, and opened ODATA-1115 to discuss similar changes to defaults for Precision and Scale.

            People

            • Assignee:
              Unassigned
              Reporter:
              handl Ralf Handl
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: