2.2.6.3.5 Collection of Complex Type Instances

A collection of ComplexType instances MUST be represented as an array of JSON objects. Each object in the array represents a single ComplexType instance as specified in Complex Type (section 2.2.6.3.4).

The syntax of the Verbose JSON representation of a collection of ComplexType instances is defined by the grammar listed in this section. The grammar rule "entityCollCTInVJson" defines the Verbose JSON representation of a collection of ComplexType instances that can be used in all versions of request payloads and OData 1.0 response payloads. The grammar rule "entityCollCTInVJson2" defines the OData 2.0 Verbose JSON representation of a collection of ComplexType instances for response payloads only. The grammar rule "entityCollCTInVJson3" defines the OData 3.0 Verbose JSON representation of a collection of ComplexType instances for response payloads only.

 ; Request and OData 1.0 response Verbose JSON representation of a collection of ComplexType instances:
 entityCollCTInVJson =  begin-array
                       entityCTValue      ; see section 2.2.6.3.4
                       *(value-seperator entityCTValue)
                       end-array
  
 ; OData 2.0 response Verbose JSON representation of a collection of ComplexType instances;
 entityCollCTInVJson2 = begin-object
                       resultsNVP
                       [(value-seperator entityCTMetadata)] ; see section 2.2.6.3.4
                       end-object
  
 ; OData 3.0 response Verbose JSON representation of a collection of ComplexType instances:
 entityCollCTInVJson3 = begin-object
                       [collMetadataNVP value-seperator]
                       resultsNVP
                       end-object
  
 collMetadataNVP =   quotation-mark "__metadata" quotation-mark
                     name-seperator
                     begin-object
                     [collComplexTypeNVP]
                     end-object
  
 collComplexTypeNVP = quotation-mark "type" quotation-mark
                     name-seperator
                     quotation-mark "Collection(" complexTypeNVP ")" quotation-mark
  
 resultsNVP          = quotation-mark "results" quotation-mark
                       name-seperator
                       begin-array
                       entityCTValue      ; see section 2.2.6.3.4
                       *(value-seperator entityCTValue)
                       end-array