Search code examples
jsonwcf-data-servicesodata

Is odata json light still returning metadata


I have a WCF Data Service that I am calling using datajs. When I make the request I supply the following headers. What I am getting back still has the __metadata in it which makes me wonder... Do I need to configure anything on the server? Is JSON light supported in 5.0.1.0?

Headers:

request.headers = {
    "MaxDataServiceVersion": "3.0", 
    "Accept": "application/json;odata=light;q=1,application/json;odata=verbose;q=0.5"
};

Solution

  • WFC DS 5.0.1 doesn't support JSON Light. And since your Accept header allows Verbose JSON to be used, it will be used. You can confirm this by looking at the Content-Type header of the response. We don't have publicly available bits with JSON Light support. We only have experimental service with current thinking of JSON Light. You can try it here: http://services.odata.org/Experimental/OData/OData.svc/