https://github.com/bonsai-rx/sgen
Tool for automatically generating serialization classes from schema files
https://github.com/bonsai-rx/sgen
bonsai-rx code-generation json yaml
Last synced: 8 months ago
JSON representation
Tool for automatically generating serialization classes from schema files
- Host: GitHub
- URL: https://github.com/bonsai-rx/sgen
- Owner: bonsai-rx
- License: mit
- Created: 2023-07-17T07:21:59.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-08T23:54:24.000Z (12 months ago)
- Last Synced: 2025-07-22T07:57:03.441Z (11 months ago)
- Topics: bonsai-rx, code-generation, json, yaml
- Language: C#
- Homepage: http://bonsai-rx.org/sgen/
- Size: 159 KB
- Stars: 3
- Watchers: 3
- Forks: 5
- Open Issues: 14
-
Metadata Files:
- Readme: docs/README.md
- License: LICENSE
Awesome Lists containing this project
README
# Serializer Generator Tool
`Bonsai.Sgen` is a code generator tool for the [Bonsai](https://bonsai-rx.org/) programming language. It leverages [JSON Schema](https://json-schema.org/) as a standard to specify [record data types](https://en.wikipedia.org/wiki/Record_(computer_science)), and automatically generates operators to create and manipulate these objects. It builds on top of [NJsonSchema](https://github.com/RicoSuter/NJsonSchema) by providing further customization of the generated code as well as Bonsai-specific features.
## Getting Started
1. Install `Bonsai.Sgen` as a local tool:
```cmd
dotnet new tool-manifest
```
```cmd
dotnet tool install --local Bonsai.Sgen
```
2. Generate YAML or JSON serialization classes from a schema file to your project `Extensions` folder:
```cmd
dotnet bonsai.sgen schema.json -o Extensions --serializer yaml
```
```cmd
dotnet bonsai.sgen schema.json -o Extensions --serializer json
```
3. Add the necessary package references to your `Extensions.csproj` file:
```xml
```
```xml
```
## Additional Documentation
For additional documentation and examples, refer to the [Sgen documentation pages](https://bonsai-rx.org/sgen/articles/basic-usage.html).
## Feedback & Contributing
`Bonsai.Sgen` is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/bonsai-rx/sgen).