I'm getting an exception on my Web API controller endpoint and I would appreciate some help solving it.
Here is the story:
In my Web API project, a controller exposes the following endpoints:

My Kendo UI Datagrid makes the following request:
http://localhost:63865/api/employees/GetAll?$callback=jQuery21109420544053427875_1410883352953&%24inlinecount=allpages&%24format=json&%24top=5
I'm getting this exception when validating the ODataQueryOptions sent in the request:
Query option 'Format' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.

But I've enabled all query options:
[EnableQuery(AllowedQueryOptions=AllowedQueryOptions.All)]
What am I doing wrong ?
Finally manage to get to the bottom of this!
After creating the ODataValidationSettings object I needed to change the AllowedQueryOptions to AllowedQueryOptions.All. Be default all options are there except the Format and SkipToken.

Anyway, hope this may help anyone else facing the same issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With