Forge.Parse
1.20.0
dotnet add package Forge.Parse --version 1.20.0
NuGet\Install-Package Forge.Parse -Version 1.20.0
<PackageReference Include="Forge.Parse" Version="1.20.0" />
<PackageVersion Include="Forge.Parse" Version="1.20.0" />
<PackageReference Include="Forge.Parse" />
paket add Forge.Parse --version 1.20.0
#r "nuget: Forge.Parse, 1.20.0"
#:package Forge.Parse@1.20.0
#addin nuget:?package=Forge.Parse&version=1.20.0
#tool nuget:?package=Forge.Parse&version=1.20.0
Forge.Parse 1.20.0
Structured JSON expectation matching for dynamic .NET tests.
Website: https://pjotrcasteel.github.io/Forge/ · NuGet: https://www.nuget.org/packages/Forge.Parse · Source: https://github.com/pjotrcasteel/Forge
Forge.Parse makes JSON assertions readable when IDs, timestamps and relationships are created at runtime.
Install
dotnet add package Forge.Parse --version 1.20.0
Five-minute start
using Forge.Parse;
JsonAssert.Matches(
"""
{
"id": "<Guid>",
"state": "<OneOf:pending|active>",
"reference": "<Regex:^ORD-[0-9]+$>",
"createdAt": "<DateTimeOffset>"
}
""",
actualJson);
Objects are partial by default: extra properties in the actual JSON do not create noise.
Dynamic relationships
{
"id": "<Capture:serviceId>",
"dependency": {
"serviceId": "<Same:serviceId>"
}
}
Use <Present> and <Missing> for property presence, and <<Guid>> when the literal string <Guid> is expected.
Matching modes
JsonMatchOptions.Partial;
JsonMatchOptions.Exact;
JsonMatchOptions.Unordered;
JsonMatchOptions.UnorderedSubset;
Target specific paths when needed:
var options = JsonMatchOptions.Partial
.Ignore("$.metadata.generatedAt")
.UseUnorderedArrayMatching("$.items");
Built-in expectations
Forge.Parse includes type, shape, string, numeric, array-count and relationship matchers such as:
<Guid>, <NotEmptyGuid>, <String>, <Int>, <Number>, <Bool>, <DateTimeOffset>, <Uri>, <Regex:...>, <OneOf:a|b>, <GreaterThan:10>, <ArrayMinCount:1>, <Capture:name>, <Same:name>.
Custom expectations can be implemented with IValueMatcher or DelegateValueMatcher.
Forge family
- Forge.Delta — what changed inside this object?
- Forge.Sync — how does current state become desired state?
- Forge.Parse — does structured dynamic output satisfy this expectation?
Forge.Parse is test-oriented and does not own application behavior, persistence or execution.
.NET 10 · MIT.
| Product | Versions 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Forge.Parse:
| Package | Downloads |
|---|---|
|
Forge.Parse.Reqnroll
Reqnroll DataTable integration for Forge.Parse structured JSON matching. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.20.0 | 135 | 9/29/2026 |
Forge.Parse joins the Forge family with structured JSON expectation matching, dynamic placeholders, capture/reuse semantics, custom matchers, and structured diagnostics.