diff --git a/pages/documentation/json-format-v2.html b/pages/documentation/json-format-v2.html index e49f0db..3dc684c 100644 --- a/pages/documentation/json-format-v2.html +++ b/pages/documentation/json-format-v2.html @@ -263,7 +263,7 @@
As described in the Resource Path section in the [OData-URI] document, OData supports directly addressing a Property of an Entry. The following subsections describe how each type of Property is represented in JSON.
When represented in a request/response payload as part of an Entry, Complex Type or a standalone construct in a request payload, primitive properties are represented in JSON as a name/value pair, with the name equal to the name of the property and primitive type value formatted as described by the table in the Primitive Types section above. Starting with OData V2, when a primitive property is represented as a standalone construct in a response from an OData service (such as when a retrieve request is made to a URI that identifies a single property) it is represented as the value of a "results" name/value pair. For example, the response payload to a retrieve request that identifies the Name property of a Category Entry is represented as shown below.
-{% highlight javascript %}OData V2 Response Payload: { "d" : { "results": { "Name": "Bread" }{% endhighlight %} +{% highlight javascript %}OData V2 Response Payload: { "d" : { "results": { "Name": "Bread" } } }{% endhighlight %}When represented as a property of an Entry or Complex Type in a request/response payload, a property whose type is a complex type is represented as a JSON object with each property of the complex type represented as a name/value pair (as described in the prior section for primitive properties). For example, the Address Complex Type of a Supplier Entry is shown in the example below. Starting with OData V2, in response payloads only, when a property whose type is a complex type is represented as a standalone construct, such as when a retrieve request is made to a URI that identifies a single property, it is represented as the value of a "results" name/value pair. For example, the response payload to a retrieve request that identifies the Name property of a Category Entry is represented as shown below.
{% highlight javascript %}OData V2 Response Payload: { @@ -313,5 +313,5 @@If a Service Operation returns a collection of Entries or a single Entry, then the Entries (or Entry) are formatted in the same way as described in the Representing Collections of Entries or Representing an Entry section. If a Service Operation returns a single primitive value, then it is formatted as per the Representing Primitive Properties section. Likewise, if a Service Operation returns a single Complex Type value, then it is represented as per the Representing Complex Type Properties section. If a Service Operation returns a collection of primitive values, then the primitives are returned as a JSON array as shown in the example below.
-{% highlight javascript %}{ "d" : [ 0, 1, 2 ] }{% endhighlight %} +{% highlight javascript %}{ "d" : { "results": [ 0, 1, 2 ] } }{% endhighlight %}If a Service Operation returns a collection of complex types, then a JSON array of objects are returned, one object per complex type. Each complex type is represented as described in the Representing Complex Type Properties section above.