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
I did not configure QueryOption globally, nor did I use a specific convention model configuration. I only used EnableQuery, but the $skip and $top parameters are not displayed in Swagger, and $count cannot be used.
I tried add $skip=1&$top=1 to query string by curl in terminal, and response say The limit of '0' for Top query has been exceeded
Expected Behavior
I hope to be able to use $count as defined in EnableQuery and have the $select, $top, and $skip parameters correctly worked.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.401
Anything else?
No response
The text was updated successfully, but these errors were encountered:
This is almost certainly an external issue with OData itself. Let's start by reviewing #944, which also has a deep link over to the OData repo where I outline the issue further.
Ultimately, the API Explorer extensions only document OData query options. It doesn't change anything about how they work. The Litmus test is trying to get it working without API Versioning. I suspect in this case, it will not work. I've tried to provide comprehensive examples to show working OData combinations, which aren't always straight forward.
If you find that $top does work as expected, but then fails when you add API Versioning and/or it's API Explorer extensions, then it's worth taking a deeper look. I have a strong feeling, this is a simple OData misconfiguration.
As I recall, you must do one of the following for [EnableQuery] to take effect:
Enable global query options
Use Model Bound query settings via:
Attributes declared on your model (ex: [Select], [Page], etc)
Conventions defined via the ODataModelBuilder (ex: .Select(...), .Page(...), etc)
This is almost certainly an external issue with OData itself. Let's start by reviewing #944, which also has a deep link over to the OData repo where I outline the issue further.
Ultimately, the API Explorer extensions only document OData query options. It doesn't change anything about how they work. The Litmus test is trying to get it working without API Versioning. I suspect in this case, it will not work. I've tried to provide comprehensive examples to show working OData combinations, which aren't always straight forward.
If you find that $top does work as expected, but then fails when you add API Versioning and/or it's API Explorer extensions, then it's worth taking a deeper look. I have a strong feeling, this is a simple OData misconfiguration.
As I recall, you must do one of the following for [EnableQuery] to take effect:
Enable global query options
Use Model Bound query settings via:
Attributes declared on your model (ex: [Select], [Page], etc)
Conventions defined via the ODataModelBuilder (ex: .Select(...), .Page(...), etc)
I update OData configuration and $top and $skip working, but still not appear in Api Explorer
Is there an existing issue for this?
Describe the bug
I used
Asp.Versioning.OData.ApiExplorer 8.1.0
AddODataApiExplorer
with the following configuration:Program.cs
ExperimentsController
I did not configure QueryOption globally, nor did I use a specific convention model configuration. I only used EnableQuery, but the $skip and $top parameters are not displayed in Swagger, and $count cannot be used.
I tried add
$skip=1&$top=1
to query string by curl in terminal, and response sayThe limit of '0' for Top query has been exceeded
Expected Behavior
I hope to be able to use $count as defined in EnableQuery and have the $select, $top, and $skip parameters correctly worked.
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
8.0.401
Anything else?
No response
The text was updated successfully, but these errors were encountered: