2.2.6.3.13 Collection Property

Applies to the OData 3.0 protocol

In the OData 3.0 protocol, a collection property of a ComplexType or EDMSimpleType MUST be represented in the same way as collections of a ComplexType, as described in Collection of Complex Type Instances (section 2.2.6.3.5). Similarly, collections of EDMSimpleTypes MUST be represented the same as collections of EDMSimpleTypes, as described in Collection of EDMSimpleType Values (section 2.2.6.3.7). A "__metadata" object with a name/value pair called “type” MAY be present to specify the EDMSimpleType or the ComplexType.

 {
    "__metadata": { "uri": "Customers(\'ALFKI\')",
                    "type": "SampleModel.Customer",
                    "etag": "W/\"X\'000000000000FA01\'\"",
                     "properties" : {
                               "Orders" : {
                                 "associationuri" : " Customers(\'ALFKI\')/$links/Orders "
                               }
                      }               
                    },
    "CustomerID": "ALFKI",
    "CompanyName": "Alfreds Futterkiste",
    "Address": { "Street": "57 Contoso St", "City": "Seattle" },
    "Version": "AAAAAAAA+gE=",
   "EmailAddresses": {"__metadata": { "type": "Collection(Edm.String)" }, 
              "results":["mike@company.com", "mike2@company.com"]},
   "AlternateAddresses":{"__metadata": { "type": "Collection(SampleModel.Address)" }, 
              "results":[{"Street": "123 contoso street", "Apartment": "508"}, 
                         {"__metadata": { "type": "SampleModel.EAddress"},
                          "Street": "834 1st street" }
                         ]},
    "Orders":  { "__deferred": { "uri": "Customers(\'ALFKI\')/Orders" } }
  }

Listing: Verbose JSON-Formatted Customer Entity with Collection Properties