JSON Schema in other languages
The Corvus JSON Schema evaluator is not only for .NET. The same evaluator, with the same behaviour, is available for JavaScript and TypeScript, Rust, Java and Kotlin, Go, Julia, Object Pascal, OCaml, Python, C, C++, Swift, Fortran, Ruby, PHP and R.
| Language | Package | Install |
|---|---|---|
| .NET (C#) | Corvus.Text.Json.Validator (see also the runtime evaluator) | dotnet add package Corvus.Text.Json.Validator |
| JavaScript and TypeScript | @corvus-dotnet/json-schema | npm install @corvus-dotnet/json-schema |
| Rust | corvus-json-schema | cargo add corvus-json-schema |
| Java and Kotlin | io.github.corvus-dotnet:corvus-json-schema | Maven or Gradle |
| Go | github.com/corvus-dotnet/Corvus.JsonSchema/src-go/corvus-json-schema | go get github.com/corvus-dotnet/Corvus.JsonSchema/src-go/corvus-json-schema |
| Julia | CorvusJsonSchema | pkg> add CorvusJsonSchema |
| Object Pascal | The corvus-json-schema source package, for Free Pascal | Source archives |
| OCaml | corvus-json-schema, an opam package | opam pin add corvus-json-schema https://github.com/corvus-dotnet/corvus-json-schema-ocaml.git#v0.1.1 |
| Python | corvus-json-schema, corvus-json-schema-rs | pip install corvus-json-schema-rs |
| C | The corvus-json-schema C library | Release packages |
| C++ | The C library's header-only C++17 wrapper | Release packages |
| Swift | CorvusJsonSchema | Swift Package Manager |
| Fortran | corvus-json-schema, an fpm and CMake package | fpm (a git dependency) or CMake |
| Ruby | corvus_json_schema | gem install corvus_json_schema |
| PHP | corvus-dotnet/corvus-json-schema | pie install corvus-dotnet/corvus-json-schema |
| R | corvusjsonschema | install.packages("corvusjsonschema", repos = "https://corvus-dotnet.r-universe.dev") |
What they share
- The same evaluator. Each is a port of, or built on a port of, the .NET runtime evaluator. The Rust crate is the engine behind the Python (Rust-backed), Ruby, PHP and R packages and the C library, and the C library is the engine behind the C++ wrapper and the Swift and Fortran packages. The JavaScript and pure-Python packages compile schemas into their own languages' code, and the Java library compiles them into JVM bytecode. The Go module is a port of the Rust crate's plans to Go, with no native code, and the Julia package, the Object Pascal package and the OCaml package are each a port of the Go module.
- The same results. Every implementation evaluates drafts 4, 6, 7, 2019-09 and 2020-12, passes the JSON-Schema-Test-Suite, and reports results at the Basic, Detailed and Verbose levels, with the same rows (evaluation path, schema location, instance location and message, in the same order). Annotations come grouped the same way everywhere: instance location, then keyword, then schema location, then value (in R, as the columns of a data frame). Results from any of them can be consumed the same way.
- The same patterns.
pattern,patternPropertiesand theregexformat are ECMA-262 regular expressions in every port, tested against V8's answers. How each port matches them, what it refuses and how it limits a match are in Patterns across the ports. - The same options. The default dialect, format and content assertion, custom formats, a document resolver for remote references, a base URI, an entry point and a recursion limit, each named in its language's idiom.
- Fast validation. Each validates without collecting anything unless asked; results collection is a separate path that costs nothing when it is not used. The native implementations read their languages' own values in place, and validate JSON text without creating values for it.