finds.dev← search

// the find

JamesNK/Newtonsoft.Json.Schema

★ 256 · C# · NOASSERTION · updated May 2025

Json.NET Schema is a powerful, complete and easy to use JSON Schema framework for .NET

Json.NET Schema is the JSON Schema validation and generation library for the Newtonsoft.Json ecosystem — if you're already on Json.NET and need to validate documents or generate schemas from .NET types, this is the obvious choice. It supports drafts 4 through 2020-12 and handles the full $ref resolution and cross-file loading story that the spec compliance tests cover.

Streaming validation via JSchemaValidatingReader/Writer means you can validate while reading/writing without loading the entire document into memory. Schema generation from .NET types integrates directly with Json.NET's contract resolver, so your existing JsonConverter and DataAnnotations attributes are respected. The test suite is unusually thorough — hundreds of issue regression tests plus the official JSON Schema spec test suites for multiple drafts.

It's tied to Newtonsoft.Json, which is a legacy dependency — if you're on System.Text.Json (the .NET default since .NET 3+), you can't use this at all. The license is commercial for high-volume use (validation calls above a threshold require a paid license), which catches people off guard and is buried in the docs. The schema generator makes a best-effort guess for .NET types but has known gaps around polymorphism and nullable reference types — it won't reliably produce correct oneOf/anyOf for inheritance hierarchies. Stars are low (256) relative to the core Json.NET library (11k+), which reflects that most people don't need JSON Schema validation or have moved on from the Json.NET stack.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →