Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between OData v3 and OData v4

We have a requirement of using both Odata v3 and Odata v4.

Actually we need to hit the web services exposing both these versions. We are using Java platform. What are the changes between these two versions — Will it be a major change?

Query formation to hit those web services changes depending upon the version? Does the API also change? What are the technical points we need to take care of while calling both of these versions?

Will there be any difference in the response we get? I heard the default response for v4 is JSON and for V3 is XML — is that true?

I tried with the below examples:

http://services.odata.org/V3/Northwind/Northwind.svc/Customers

http://services.odata.org/V4/Northwind/Northwind.svc/Customers

Kindly provide us the details.

like image 363
Vikram R Avatar asked Feb 16 '15 09:02

Vikram R


People also ask

What is difference between OData v2 and v4?

According to the OData 2 specification, payload had to be retrieved in both XML and JSON formats. In OData 4 however, XML is optional. So, Hybrid Data Pipeline today supports both XML and JSON in OData 2 and only JSON in OData 4. However, the metadata can still be retrieved in the XML format in OData 4.

What is OData v4?

The Open Data Protocol (OData) enables the creation of REST-based data services, which allow resources, identified using Uniform Resource Locators (URLs) and defined in an Entity Data Model (EDM), to be published and edited by Web clients using simple HTTP messages.

What is the latest version of OData?

OData Version 4.01 The OASIS OData Technical Committee has published the latest OData 4.01 draft as a Committee Specification.


1 Answers

There are quite some differences between OData v3 and v4, so it is most likely not going to be straightforward to support v4.

  • See the OData v4 Specifications
  • See What’s New in OData Version 4.0

As far as I know the default format in v4 is indeed JSON, but it also supports XML; you're not required to use JSON.

like image 90
Jesper Avatar answered Oct 14 '22 01:10

Jesper