Skip to content

No pagination links or total meta in included resource collection #1738

@bjornharrtell

Description

@bjornharrtell

DESCRIPTION

It appears it's not possible to get pagination links or total meta in included resource collection. Perhaps it's more of missing feature than bug...

STEPS TO REPRODUCE

Running the example JsonApiDotNetCoreExample and making request http://localhost:14140/api/people?fields[people]=assignedTodoItems&include=assignedTodoItems&page[size]=2,assignedTodoItems:2 returns payload:

{
  "links": {
    "self": "/api/people?fields[people]=assignedTodoItems&include=assignedTodoItems&page[size]=2,assignedTodoItems:2",
    "describedby": "/swagger/v1/swagger.json",
    "first": "/api/people?fields%5Bpeople%5D=assignedTodoItems&include=assignedTodoItems&page%5Bsize%5D=2,assignedTodoItems%3A2",
    "last": "/api/people?fields%5Bpeople%5D=assignedTodoItems&include=assignedTodoItems&page%5Bsize%5D=2,assignedTodoItems%3A2&page%5Bnumber%5D=25",
    "next": "/api/people?fields%5Bpeople%5D=assignedTodoItems&include=assignedTodoItems&page%5Bsize%5D=2,assignedTodoItems%3A2&page%5Bnumber%5D=2"
  },
  "data": [
    {
      "type": "people",
      "id": "1",
      "relationships": {
        "assignedTodoItems": {
          "links": {
            "self": "/api/people/1/relationships/assignedTodoItems",
            "related": "/api/people/1/assignedTodoItems"
          },
          "data": [
            {
              "type": "todoItems",
              "id": "376"
            },
            {
              "type": "todoItems",
              "id": "76"
            }
          ]
        }
      },
      "links": {
        "self": "/api/people/1"
      }
    },
    {
      "type": "people",
      "id": "2",
      "relationships": {
        "assignedTodoItems": {
          "links": {
            "self": "/api/people/2/relationships/assignedTodoItems",
            "related": "/api/people/2/assignedTodoItems"
          },
          "data": []
        }
      },
      "links": {
        "self": "/api/people/2"
      }
    }
  ],
  "included": [
    {
      "type": "todoItems",
      "id": "376",
      "attributes": {
        "description": "TodoItem376",
        "priority": "High",
        "durationInHours": 375,
        "createdAt": "2025-06-05T15:08:00.899032+00:00",
        "modifiedAt": null
      },
      "relationships": {
        "owner": {
          "links": {
            "self": "/api/todoItems/376/relationships/owner",
            "related": "/api/todoItems/376/owner"
          }
        },
        "assignee": {
          "links": {
            "self": "/api/todoItems/376/relationships/assignee",
            "related": "/api/todoItems/376/assignee"
          }
        },
        "tags": {
          "links": {
            "self": "/api/todoItems/376/relationships/tags",
            "related": "/api/todoItems/376/tags"
          }
        }
      },
      "links": {
        "self": "/api/todoItems/376"
      }
    },
    {
      "type": "todoItems",
      "id": "76",
      "attributes": {
        "description": "TodoItem076",
        "priority": "High",
        "durationInHours": 75,
        "createdAt": "2025-06-05T15:08:00.898895+00:00",
        "modifiedAt": null
      },
      "relationships": {
        "owner": {
          "links": {
            "self": "/api/todoItems/76/relationships/owner",
            "related": "/api/todoItems/76/owner"
          }
        },
        "assignee": {
          "links": {
            "self": "/api/todoItems/76/relationships/assignee",
            "related": "/api/todoItems/76/assignee"
          }
        },
        "tags": {
          "links": {
            "self": "/api/todoItems/76/relationships/tags",
            "related": "/api/todoItems/76/tags"
          }
        }
      },
      "links": {
        "self": "/api/todoItems/76"
      }
    }
  ],
  "meta": {
    "total": 50
  }
}

EXPECTED BEHAVIOR

I'd expect pagination links and total meta for any included collection data.

ACTUAL BEHAVIOR

Pagination links and total meta appears not to be available for included collection data.

VERSIONS USED

  • JsonApiDotNetCore version: Run from source at 3c6d3be

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy