2
votes

I have this question on OData based services. As a consumer of OData Service, can I assume that any OData compliant data service would expose its data in ATOM and JSON format.

Is it possible that there is a OData service that expose its feeds in ATOM but not in JSON format?

In my application as a consumer of OData (OData CLient) we are always fetching the data in JSON format. This would fail when the OData Service only supports ATOM.

4

4 Answers

4
votes

The specification has changed again in OData Version 4.0:

An OData service MUST support at least one of [OData-JSON] or [OData-Atom], and MAY support additional formats for both request and response bodies.

3
votes

The specification talks about both ATOM and JSON, but in reality not all services support both. I've seen a couple which only supports ATOM for now. So yes, it is possible to expose an OData services which only supports for example ATOM. Whether such service complies with the specification is kind of not interesting, since if you can't consume ATOM you won't be able to talk to such service regardless of the specification.

2
votes

The V3 documentation is unambiguous:

  • OData Services MUST support the ATOM encoding.
  • OData services SHOULD support a JSON encoding.
2
votes

From the specification, I think the ATOM is default way for OData data feed. and it can be easy to convert to JSON with ?$format=json may be you can try to use ?$format=atom