OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
855 stars 473 forks source link

OData 9.0 Returning 200 with Broken JSON #2862

Closed sarangp93 closed 1 week ago

sarangp93 commented 1 week ago

Hello everyone,

I'm currently working with .NET 8, OData 9, EF Core 8, and PostgreSQL. When I make requests using certain OData queries that are valid in OData but incompatible with EF Core, the response I receive is broken JSON with 200 status code instead of a clear error message. Here are a couple of example queries that reproduce the issue:

?$expand=Orders($compute=Amount div 0 as test; $select = *;) ?$expand=AllMovies($filter=category/any(x: x eq null)) If anyone has suggestions or knows of a way to handle or catch these errors gracefully, I’d appreciate your input.

Capture2