Intility.JsonApiToolkit 2.1.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Intility.JsonApiToolkit --version 2.1.2
                    
NuGet\Install-Package Intility.JsonApiToolkit -Version 2.1.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Intility.JsonApiToolkit" Version="2.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Intility.JsonApiToolkit" Version="2.1.2" />
                    
Directory.Packages.props
<PackageReference Include="Intility.JsonApiToolkit" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Intility.JsonApiToolkit --version 2.1.2
                    
#r "nuget: Intility.JsonApiToolkit, 2.1.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Intility.JsonApiToolkit@2.1.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Intility.JsonApiToolkit&version=2.1.2
                    
Install as a Cake Addin
#tool nuget:?package=Intility.JsonApiToolkit&version=2.1.2
                    
Install as a Cake Tool

<h1 align="center"> <img src="https://avatars.githubusercontent.com/u/35199565" width="124px"/><br/> JsonApiToolkit </h1>

<p align="center"> <em>Build JSON:API endpoints in ASP.NET Core.</em> </p> <p align="center"> <a href="https://dotnet.microsoft.com/"> <img src="https://img.shields.io/badge/.NET-10.0-blue.svg?logo=dotnet&logoColor=white&label=.NET" alt=".NET version"> </a> <a href="https://www.nuget.org/packages/Intility.JsonApiToolkit"> <img src="https://img.shields.io/nuget/v/Intility.JsonApiToolkit.svg?logo=nuget&logoColor=white&label=NuGet" alt="NuGet"> </a> <a href="https://jsonapi.org/"> <img src="https://img.shields.io/badge/JSON%3AAPI-1.1-blue.svg" alt="JSON:API version"> </a> <a href="https://github.com/intility/json-api-toolkit/blob/main/LICENSE"> <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License"> </a> <a href="https://github.com/intility/json-api-toolkit/actions/workflows/ci-cd.yml"> <img src="https://github.com/intility/json-api-toolkit/actions/workflows/ci-cd.yml/badge.svg" alt="CI/CD"> </a> </p>

Description

JsonApiToolkit translates JSON:API query parameters (filter[], sort, include, fields[], page[]) into typed EF Core queries and shapes responses as spec-compliant documents, so your ASP.NET Core controllers stay short.

Installation

dotnet add package Intility.JsonApiToolkit

Usage

Register the toolkit in Program.cs:

builder.Services.AddJsonApiToolkit();

Derive controllers from JsonApiController and let JsonApiQueryAsync handle the request:

public class BooksController : JsonApiController
{
    private const string ResourceType = "book";

    [HttpGet]
    [AllowedIncludes("author", "publisher")]
    public async Task<IActionResult> GetAllAsync()
    {
        return await JsonApiQueryAsync(_dbContext.Books, ResourceType);
    }
}

Then call the endpoint with JSON:API query parameters:

GET /api/books?filter[title]=javascript&include=author&fields[book]=title,published&page[size]=10&sort=-published

What it provides

  • JSON:API documents - compliant data / included / meta / links / errors envelope on every response
  • Filtering - filter[field]=value with operators, nested paths, and filtering on included resources
  • Sorting - sort=field,-other with multi-field and descending support
  • Pagination - page[number] / page[size] with link generation, total counts, and clamping
  • Sparse fieldsets - fields[type]=a,b to limit returned attributes per resource type
  • Included resources - include=author,publisher.country with allowlisting via [AllowedIncludes]
  • EF Core integration - query operators translate directly to SQL via IQueryable
  • Strict mode - return 404 for out-of-range pages and validate filter paths against allowed includes

Documentation

Full documentation is at https://intility.github.io/json-api-toolkit/.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.4 0 5/11/2026
2.1.3 0 5/11/2026
2.1.2 0 5/11/2026