XUnitAssured.Jsonata 6.43.0

dotnet add package XUnitAssured.Jsonata --version 6.43.0
                    
NuGet\Install-Package XUnitAssured.Jsonata -Version 6.43.0
                    
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="XUnitAssured.Jsonata" Version="6.43.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XUnitAssured.Jsonata" Version="6.43.0" />
                    
Directory.Packages.props
<PackageReference Include="XUnitAssured.Jsonata" />
                    
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 XUnitAssured.Jsonata --version 6.43.0
                    
#r "nuget: XUnitAssured.Jsonata, 6.43.0"
                    
#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 XUnitAssured.Jsonata@6.43.0
                    
#: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=XUnitAssured.Jsonata&version=6.43.0
                    
Install as a Cake Addin
#tool nuget:?package=XUnitAssured.Jsonata&version=6.43.0
                    
Install as a Cake Tool

XUnitAssured.Jsonata

JSONata expressions for XUnitAssured: select, transform and assert on the JSON a step returns.

var resposta = await Given(api).ApiResource("/pedidos").Post(pedido).ExecuteAsync();
var saida = resposta.GetResult().ToJsonObject();   // { status, headers, body }

JsonataExpression.AssertTrue("status = 201 and $exists(body.id)", saida);
var total = JsonataExpression.Evaluate("$sum(body.itens.(preco * qtd))", saida).Required("total");
var caros = JsonataExpression.Evaluate("body.itens[preco > 100].sku", saida).Value;

Variables are passed by name and read as $name:

JsonataExpression.AssertTrue("body.cliente.id = $clienteId", saida,
    new Dictionary<string, JsonNode?> { ["clienteId"] = clienteId });

ToJsonObject() exists on the HTTP, Kafka and RabbitMQ results, with body in all three (the JSON of the body when it is JSON, its text otherwise).

What this package adds to JSONata

  • A time limit (5 s by default, JsonataOptions.Timeout) and a recursion limit (250): a runaway expression fails the test instead of hanging it or crashing the process.
  • $jwt(token): the claims of a JWT payload, without checking the signature.
  • Date formats are .NET formats (yyyy-MM-dd), as in Jsonata.Net.Native. A picture in the XPath format of the JSONata docs ([Y0001]-[M01]-[D01]) in $fromMillis, $toMillis or $now fails with an error that says so, instead of returning wrong text. Number formats ($formatNumber, $formatInteger, $parseInteger) are also .NET formats.
  • A variable cannot take the name of a function (sum, count, ...): it would hide it.

Built on Jsonata.Net.Native.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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
6.43.0 59 11/7/2026
6.42.0 67 11/6/2026
6.41.0 57 11/6/2026
6.40.0 57 11/6/2026
6.39.0 57 11/6/2026
6.38.0 56 11/5/2026
6.37.1 56 11/5/2026
6.37.0 56 11/5/2026
6.36.1 112 10/29/2026
6.36.0 135 10/18/2026

New in XUnitAssured.Camunda: CamundaHubClient, a client of the Camunda Hub (the Web Modeler) REST API, v1 and v2, with OAuth only: workspaces, projects, folders, files with their revision, and versions. No breaking changes. Release notes: https://github.com/andrewBezerra/xunit-assured-net/blob/main/docs/releases/6.43.0.md