OData / OData/AspNetCoreOData

Odate 8.0.11 returning invalid json 'value [' when we use top & skip

Open
#764 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Versions:
net core 6.0
oData 8.0.11

Issue started when I have upgraded my application from dotnet core 3.1 to net 6.0 and oData 7.5.0 to 8.0.11 .

Issue Description:
When we send a get request with skip & top it start returning invalid empty json after a couple of skip. Like we had 5000 records and we started get top=100 and skip=0, then top=100, skip=100 then top=100, skip=200 and so on. . . , So it start returning invalid empty response content "value": [ with status code 200. But we have more records that need to return. If content is really empty it should return a valid empty content like "value" : [ ]. with may be status code 204 mean "no content".

Query:
select query that i am using :
https://localhost:44398/v1.0/ApplicationMetadata?$filter=LastAccessTime gt 2021-11-24T00:00:00.679Z and Changeset ne '0' and Changeset ne ' '&$top=100&$skip=3200

Response Message
{
"@odata.context": "https://localhost:44398//v1.0/$metadata#ApplicationMetadata",
"value": [

image

Controller
image

Model Class

image

EDM (CSDL) Model
image

Startup oData Setup
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the controller, model class, EDM (CSDL) model, and Startup OData setup shown in the report, then reproduce the filtered request with increasing $skip values. Compare the response at the first failing offset with earlier pages; done means the endpoint returns valid JSON and correct pagination when records remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.