-
Notifications
You must be signed in to change notification settings - Fork 0
oData
cmshawns edited this page Oct 7, 2014
·
4 revisions
Arrays are returned differently than single entities. In both cases the odata.metadata
property is added, which provides a link describing the entity type(s). Arrays of entities are then returned embedded in a value
property, while single object properties are left as-is at the root of the schema.
The following examples were taken from the demo oData V3 service:
Requesting .../OData.svc/Suppliers
returns JSON in the following format:
{
"odata.metadata": "http://.../$metadata#Suppliers",
"value": [{
"ID": 0,
"Name": "Exotic Liquids",
"Address": { ... },
},
{
"ID": 1,
"Name": "Tokyo Traders",
"Address": { ... },
}]
}
Requesting .../OData.svc/Suppliers(1)
returns JSON in the following format:
{
"odata.metadata": "http://.../$metadata#Suppliers/@Element",
"ID": 1,
"Name": "Tokyo Traders",
"Address": { ... },
}