Search code examples
c#jsonodataolingo

Prevent Microsoft OData Client from requesting Full Metadata


I am attempting to consume an Olingo OData Service with Microsoft.OData.Client. For most requests, the client sends header accept: application/json;odata.metadata=minimal, but when I try to follow a navigation property (ie GET http://localhost/odata.svc/Parent(key)/Children), the client sends header accept: application/json;odata.metadata=full. Olingo v4.2 does not support full metadata in JSON, and responds with HTTP 406 Not Acceptable.

Is there any way to force the Microsoft.OData.Client to use metadata=minimal, or is full metadata an intrinsic requirement of navigation properties?


Solution

  • After some time trying to get this to work, I decided it was easier to edit the Olingo source code to generate full metadata than to try and get Microsoft.OData.Client to behave. Open Source: 1, Microsoft: 0.