1
- # sgen
2
- Tool for automatically generating YML serialization classes from schema files
1
+ # Serializer Generator Tool
2
+
3
+ Tool for automatically generating YAML / JSON serialization classes and constructor operators from schema files.
3
4
4
5
## Getting Started
5
6
6
- 1 . Navigate to the [ Bonsai.Sgen toolbox NuGet package] ( https://www.nuget.org/packages/Bonsai.Sgen/ )
7
- 2 . Click ` NET CLI (Local) ` and copy the two suggested commands. E.g.:
7
+ 1 . Navigate to the [ Bonsai.Sgen NuGet tool package] ( https://www.nuget.org/packages/Bonsai.Sgen/ )
8
+ 2 . Click ` . NET CLI (Local)` and copy the two suggested commands. E.g.:
8
9
9
10
``` cmd
10
11
dotnet new tool-manifest # if you are setting up this repo
11
- dotnet tool install --local Bonsai.Sgen --version 0.1 .0
12
+ dotnet tool install --local Bonsai.Sgen --version 0.2 .0
12
13
```
13
14
14
15
3. To view the tool help reference documentation, run:
@@ -17,25 +18,31 @@ Tool for automatically generating YML serialization classes from schema files
17
18
dotnet bonsai.sgen --help
18
19
```
19
20
20
- 4. To generate serialization classes from a schema file:
21
+ 4. To generate YAML serialization classes from a schema file:
22
+
23
+ ```cmd
24
+ dotnet bonsai.sgen --schema schema.json --serializer YamlDotNet
25
+ ```
26
+
27
+ 5. To generate JSON serialization classes from a schema file:
21
28
22
29
```cmd
23
- dotnet bonsai.sgen --schema schema.json
30
+ dotnet bonsai.sgen --schema schema.json --serializer NewtonsoftJson
24
31
```
25
32
26
- 5 . Copy the generated class file to your project `Extensions` folder.
33
+ 6 . Copy the generated class file to your project `Extensions` folder.
27
34
28
- 6 . Add the necessary package references to your `Extensions.csproj` file. For instance :
35
+ 7 . Add the necessary package references to your `Extensions.csproj` file. For example :
29
36
30
37
```xml
31
38
<ItemGroup>
32
39
<PackageReference Include="Bonsai.Core" Version="2.8.0" />
33
- <PackageReference Include="YamlDotNet" Version="12.0.2 " />
40
+ <PackageReference Include="YamlDotNet" Version="13.7.1 " />
34
41
</ItemGroup>
35
42
</Project>
36
43
```
37
44
38
- 7 . To restore the tool at any point, run:
45
+ 8 . To restore the tool at any point, run:
39
46
40
47
```cmd
41
48
dotnet tool restore
0 commit comments