Questions tagged [odata]

The Open Data Protocol (OData) is a standardized protocol for building REST APIs. OData specifies many best practices for REST APIs, including a terse, hypermedia-oriented JSON format. Use this tag for all specification versions (v2, v3, v4.x).

The Open Data Protocol (OData) is a standardized protocol for building REST APIs. It is a web protocol for querying and updating data, which can be freely incorporated in various kinds of data access applications

OData v4 specifies many best practices for REST APIs including a terse, hypermedia-oriented JSON format.

OData v4 is an OASIS Standard, with more than 20 companies participating on the technical committee. Microsoft, SAP, Salesforce, and many other companies are strong advocates of the protocol as a solution to an otherwise fragmented REST API landscape.

This same standardization allows generic hypermedia clients to consume the service. , and are well known data clients that have support for consuming OData.

7563 questions
24
votes
1 answer

Nested filter on Data Transfer Object using OData Wep Api

I have a wep api project consumes data using odata but I'm having some problems with odata wep api. when I execute that query /api/values?$top=50&$filter=Comments/Fortuneteller/FullName eq 'some string' it gives me following error "Message": "The…
emreturan
  • 451
  • 1
  • 5
  • 18
24
votes
2 answers

ApiController vs ODataController when exposing DTOs

Can someone explain me when I should inherit my controller form ODataController vs ApiController ? The question is caused by the fact that results returned by ApiController can be filtered with OData query. If I apply QueryableAttribute to…
Pavel Voronin
  • 13,503
  • 7
  • 71
  • 137
24
votes
2 answers

using apicontroller vs odata EntitySetController

I just started learning about ASP.NET Web API and I have several things that are still unclear to me: why should I use EntitySetController,which inherits from odata controller instead of ApiController Why is EF frequently mentioned in the context…
david lopez
  • 405
  • 2
  • 5
  • 16
24
votes
2 answers

OData - filter by nested property

does anyone know how to express an OData $filter against a nested property? for ex. I have the following Atom entry, ... ...
Ariel
  • 5,752
  • 5
  • 49
  • 59
23
votes
5 answers

A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'

I am getting the following exception when calling OData from my Kendo ListView: "A binary operator with incompatible types was detected. Found operand types 'Edm.Guid' and 'Edm.String' for operator kind 'Equal'" DECODED…
Prisoner ZERO
  • 13,848
  • 21
  • 92
  • 137
23
votes
4 answers

OData read-only property

I have a WebAPI 2.2 application with OData V4. Also I'm using EF 6.1. In one of my entities I have a calculated property: public class Person { public string FirstName { get; set; } public string LastName { get; set; } // Calculated…
user3120088
  • 231
  • 2
  • 4
23
votes
6 answers

How do I interact with OData from Java?

OData is Microsoft's repackaging of its Astoria (now WCF Data Services) RESTful query/update protocol. If I want to use Java to create an OData compatible data source, how do I do that? Similarly, if I want to consume an OData data source from Java,…
user280638
23
votes
6 answers

Get OData $metadata in JSON format

is it possible to get metadata of an OData service in JSON format? When I try to use format=json , it doesn't work. Here is what I tried: http://odata.informea.org/services/odata.svc/$metadata/?format=json
Omar
  • 7,835
  • 14
  • 62
  • 108
22
votes
1 answer

Hook OData's $metadata response and convert it from XML to JSON

The answer of Get OData $metadata in JSON format states that OData cannot return the metadata as JSON by default. But is it possible then to capture or hook its response for the $metadata URL, and then convert it on the fly to JSON before sending it…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
22
votes
5 answers

OData Exception The limit of '0' for Top query has been exceeded

I am using OData Web API for Version 4, when I try to query OData web Api using $top parameter, it return me following exception message. The query specified in the URI is not valid. The limit of '0' for Top query has been exceeded. The value from…
Abdul Qadir Memon
  • 950
  • 1
  • 12
  • 27
22
votes
1 answer

Odata - nested $select and $expand

http://services.odata.org/V4/Northwind/Northwind.svc/ I'm trying to get all Customers, their Orders and corresponding Order_Details at once and using nested $expand for that. To query the data I'm using following link:…
VladL
  • 12,769
  • 10
  • 63
  • 83
21
votes
1 answer

What is the difference between Microsoft.AspNet.WebApi.OData and Microsoft.Data.OData and Microsoft.AspNet.OData?

I am creating a RESTful service using Web API and Entity Framework with OData endpoints. The Microsoft.AspNet.WebApi.OData and Microsoft.Data.OData and Microsoft.AspNet.OData packages seem to overlap, so I wasn't sure which one to use. What are the…
Brehbreh
  • 213
  • 2
  • 5
21
votes
2 answers

How to get only Odata.Count without value

Is there any way I can get only count of the data in response payload without any value array? I am using ODataV4.0 with Webapi 2.2. Currently it returns all the values and count when I query something like: http://odata/People?$count=true I just…
ManojAnavatti
  • 604
  • 1
  • 7
  • 18
20
votes
8 answers

How to handle json DateTime returned from WCF Data Services (OData)

I believe I am missing something obvious here. When I request a JSON response from an OData service I get a different result for the DateTime properties than I do when I request XML. I'll use the NerdDinner OData feed as an…
Andy May
  • 4,030
  • 5
  • 34
  • 33
20
votes
1 answer

Where does WebAPI 2.2 OData v4 [EnableQuery] apply?

Where is it correct/incorrect to apply the EnableQueryAttribute as of Jan 2015? The document linked below: http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/odata-v4/create-an-odata-v4-endpoint Says: The [EnableQuery] attribute…
Luke Puplett
  • 42,091
  • 47
  • 181
  • 266