You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is ultimately an issue with OData; however, I didn't want to just punt you over to their repo. I've updated any existing issue with comprehensive details regarding the problem in OData/AspNetCoreOData#695.
TL;DR
The crux of the problem is that Order has model bound settings applied a result of [Select] being used. This cause all other MaxTop settings to be ignored. One fix is to apply [Page(MaxTop = 42)]. That would apply to all API versions, but that might be ok. The other way is to apply it via the model builder:
This can easily be applied via IModelConfiguration (e.g. OrderConfiguration.cs) and can vary by API version. Model bound settings are enforced before [EnableQuery] so those settings end up being ignored.
It was pretty tedious to track down the main cause. I'll update the examples so that they at least work as expected.
Is there an existing issue for this?
Describe the bug
BUG:
Step to reproduce:
I assume that the parameter "top" generates exceptions for all OData examples having
options.Validate
or [EnableQuery].Expected Behavior
Response 200
Steps To Reproduce
No response
Exceptions (if any)
Microsoft.OData.ODataException: 'The limit of '0' for Top query has been exceeded. The value from the incoming request is '1'.'
.NET Version
net6.0
Anything else?
No response
The text was updated successfully, but these errors were encountered: