Differences between OData 2 and 3 Versions

The OData protocol documentation ( http://www.odata.org/documentation ) describes two versions - 2 and 3.

What are the main differences between the two versions?

Are both versions supported by existing client libraries, and is version 2 considered obsolete?

To rephrase - are version 2 clients compatible with version 3?

+7
source share
3 answers

There are many differences between the two versions. For example, OData v3 adds support for actions, functions, collection values, navigation properties for derived types, and stream properties. It also introduces a completely new serialization format for JSON ("application / json" means completely different things in two versions).

When an OData client makes a request to the server, it can (and should) specify the maximum protocol version that it can understand through the MaxDataServiceVersion HTTP header. A client written just to understand the v2 protocol will not be able to understand the v3 payload.

I donโ€™t think I would call v2 โ€œlegacyโ€ or unsupported, but individual servers can choose to support or not support requests that can only be understood before v2 (or v1). I think many existing clients support both v2 and v3. I know that WCF Data Services clients (desktop, Windows phone, Windows storage, and Silverlight) support both.

+7
source

In addition to the previous answer, remember that some client tools can only support the OData v2 protocol, so if you need special v3 functions, you must make sure that your client code is not limited to something like automatically generated proxy classes that are not capable handle array types.

Here is an example where the server provides v3 functions, but they cannot be used, because the Visual Studio WCF Data Service proxy generator supports only v2:

http://bloggingabout.net/blogs/vagif/archive/2012/12/16/using-odata-protocol-v3-with-mongodata-odata-provider.aspx

+1
source

You can find a list of all the differences between the two versions in the pdf Open Data Protocol (OData) Specification . In particular, the change log is located in the section "1.7 Versions and negotiation possibilities"

+1
source

All Articles