Corvus.Json.Cli
5.1.6
dotnet tool install --global Corvus.Json.Cli --version 5.1.6
dotnet new tool-manifest
dotnet tool install --local Corvus.Json.Cli --version 5.1.6
#tool dotnet:?package=Corvus.Json.Cli&version=5.1.6
nuke :add-package Corvus.Json.Cli --version 5.1.6
Corvus.Json.Cli
Corvus.Json.Cli installs the corvusjson command-line tool for generating C# code from JSON Schema and query-language expressions.
Install
dotnet tool install --global Corvus.Json.Cli
JSON Schema generation
Generate strongly typed C# from a JSON Schema:
corvusjson jsonschema person.json --rootNamespace MyApp.Models --outputPath Generated/
By default, corvusjson jsonschema uses the V5 engine and generates Corvus.Text.Json types. Use --engine V4 when you explicitly need the immutable Corvus.Json.ExtendedTypes model.
Common options:
| Option | Description |
|---|---|
--rootNamespace |
Namespace for generated types. |
--outputPath |
Directory for generated .cs files. |
--outputRootTypeName |
Name for the root generated type. |
--engine |
Code generation engine: V5 or V4. |
--codeGenerationMode |
TypeGeneration, SchemaEvaluationOnly, or Both. |
--assertFormat |
Enables format assertion. Defaults to true. |
Other commands
The tool also includes commands for configuration-driven generation, validation, and query-language code generation:
corvusjson config myconfig.json
corvusjson validateDocument schema.json data.json
corvusjson jsonata expression.jsonata --rootNamespace MyApp.Expressions --outputPath Generated/
corvusjson jmespath expression.jmespath --rootNamespace MyApp.Expressions --outputPath Generated/
corvusjson jsonlogic rule.json --rootNamespace MyApp.Rules --outputPath Generated/
Legacy package
The older Corvus.Json.CodeGenerator package still provides the generatejsonschematypes command as a compatibility shim. New projects should install this package and use corvusjson.
Documentation
See the CLI Code Generation guide for the full reference.
License
Apache 2.0 - see LICENSE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
This package has no dependencies.