Skip to content

Latest commit

 

History

History

samples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Samples

Beginner-friendly samples generated from JSON Schema inputs. Each schema in schemas/ is turned into idiomatic data models (the generator's definitions mode) for .NET, Go, Java, Python, and TypeScript. This is the recommended starting point for using nexgen.

For the more advanced WIT-based generation and the JSON Schema Workflow API (service/client) mode, see ../advanced/samples/.

Layout

Regenerating

From the repository root:

cargo build-examples --format json-schema            # all languages
cargo build-examples --format json-schema --lang go  # a single language

The generated definitions are checked in. cargo validate <language> checks their freshness and runs that language's sample and generated-code tests. cargo test --all-features runs Rust-only checks without language toolchains. Each example's output directory is deleted before it is regenerated, so nothing hand-written belongs in one — the tests live in the sibling tests/ directory. (The nexgen CLI itself never deletes: it writes into an existing --output directory and leaves everything already there alone.)