Purview.ZodSharp.NewtonsoftJson
2.0.0-prerelease.20
This is a prerelease version of Purview.ZodSharp.NewtonsoftJson.
dotnet add package Purview.ZodSharp.NewtonsoftJson --version 2.0.0-prerelease.20
NuGet\Install-Package Purview.ZodSharp.NewtonsoftJson -Version 2.0.0-prerelease.20
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="Purview.ZodSharp.NewtonsoftJson" Version="2.0.0-prerelease.20" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Purview.ZodSharp.NewtonsoftJson" Version="2.0.0-prerelease.20" />
<PackageReference Include="Purview.ZodSharp.NewtonsoftJson" />
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 Purview.ZodSharp.NewtonsoftJson --version 2.0.0-prerelease.20
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Purview.ZodSharp.NewtonsoftJson, 2.0.0-prerelease.20"
#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 Purview.ZodSharp.NewtonsoftJson@2.0.0-prerelease.20
#: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=Purview.ZodSharp.NewtonsoftJson&version=2.0.0-prerelease.20&prerelease
#tool nuget:?package=Purview.ZodSharp.NewtonsoftJson&version=2.0.0-prerelease.20&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Purview.ZodSharp.NewtonsoftJson
Newtonsoft.Json integration for Purview.ZodSharp . Deserialize-and-validate JSON in a single pass, create validating
JsonConverter instances, and import JSON Schema definitions (Z.FromJsonSchema).
Installation
dotnet add package Purview.ZodSharp.NewtonsoftJson
Deserialize and validate
using ZodSharp;
var userSchema = Z.Object()
.Field("name", Z.String().Min(3))
.Field("age", Z.Number().Min(0).Int())
.Build();
var json = """{ "name": "John", "age": 30 }""";
var result = userSchema.DeserializeAndValidate(json);
if (result.IsSuccess)
Console.WriteLine($"Valid: {result.Value}");
Async stream overload and JToken overload:
await using var stream = File.OpenRead("user.json");
var result = await userSchema.DeserializeAndValidateAsync(stream);
var jToken = JObject.Parse(json);
var result2 = userSchema.DeserializeAndValidate(jToken);
Validating converter
var converter = userSchema.CreateValidatingConverter();
var value = JsonConvert.DeserializeObject<User>(json, converter);
Import from JSON Schema
var schema = Z.FromJsonSchema(jsonSchemaString);
var result = schema.Validate(data);
This lets you share schemas defined in TypeScript/Zod with your .NET backend. (Export via Z.ToJsonSchema lives in the core package.)
Documentation
License
MIT — see the package metadata in Purview.ZodSharp.NewtonsoftJson on NuGet.
| Product | Versions 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.
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Newtonsoft.Json (>= 13.0.4)
- Purview.ZodSharp (>= 2.0.0-prerelease.20)
-
net8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Newtonsoft.Json (>= 13.0.4)
- Purview.ZodSharp (>= 2.0.0-prerelease.20)
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Newtonsoft.Json (>= 13.0.4)
- Purview.ZodSharp (>= 2.0.0-prerelease.20)
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.0.0-prerelease.20 | 0 | 9/23/2026 |
| 2.0.0-prerelease.19 | 0 | 9/23/2026 |
| 2.0.0-prerelease.18 | 33 | 9/22/2026 |
| 2.0.0-prerelease.17 | 35 | 9/22/2026 |
| 2.0.0-prerelease.16 | 49 | 9/21/2026 |
| 2.0.0-prerelease.15 | 48 | 9/21/2026 |
| 2.0.0-prerelease.14 | 43 | 9/21/2026 |
| 2.0.0-prerelease.13 | 52 | 9/20/2026 |
| 2.0.0-prerelease.12 | 47 | 9/20/2026 |
| 2.0.0-prerelease.11 | 46 | 9/19/2026 |
| 2.0.0-prerelease.10 | 44 | 9/19/2026 |
| 2.0.0-prerelease.9 | 47 | 9/18/2026 |
| 2.0.0-prerelease.8 | 46 | 9/17/2026 |
| 2.0.0-prerelease.7 | 61 | 9/17/2026 |
| 2.0.0-prerelease.6 | 57 | 9/14/2026 |
| 2.0.0-prerelease.5 | 61 | 9/12/2026 |
| 2.0.0-prerelease.4 | 54 | 9/12/2026 |
| 2.0.0-prerelease.3 | 72 | 9/8/2026 |
| 2.0.0-prerelease.2 | 71 | 9/6/2026 |
| 2.0.0-prerelease.1 | 71 | 9/5/2026 |