Sgen
Tool for automatically generating serialization classes from JSON Schema
Install / Use
/learn @bonsai-rx/SgenREADME
Serializer Generator Tool
Bonsai.Sgen is a code generator tool for the Bonsai programming language. It leverages JSON Schema as a standard to specify record data types, and automatically generates operators to create and manipulate these objects. It builds on top of NJsonSchema by providing further customization of the generated code as well as Bonsai-specific features.
Getting Started
-
Install
Bonsai.Sgenas a local tool:dotnet new tool-manifestdotnet tool install --local Bonsai.Sgen -
Generate YAML or JSON serialization classes from a schema file to your project
Extensionsfolder:dotnet bonsai.sgen schema.json -o Extensions --serializer yamldotnet bonsai.sgen schema.json -o Extensions --serializer json -
Add the necessary package references to your
Extensions.csprojfile:<PackageReference Include="YamlDotNet" Version="16.3.0" /><PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
[!IMPORTANT]
Make sure the above packages are installed in your Bonsai environment as well.
YamlDotNetshould be built-in, whereasNewtonsoft.Jsonmay have to be installed. To findNewtonsoft.Json, go to the package manager, click "Show advanced", and it will usually be the first package in the list.
Additional Documentation
For additional documentation and examples, refer to the Sgen documentation pages.
Feedback & Contributing
Bonsai.Sgen is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
