BootGen.Core
2.1.5
dotnet add package BootGen.Core --version 2.1.5
NuGet\Install-Package BootGen.Core -Version 2.1.5
<PackageReference Include="BootGen.Core" Version="2.1.5" />
paket add BootGen.Core --version 2.1.5
#r "nuget: BootGen.Core, 2.1.5"
// Install BootGen.Core as a Cake Addin #addin nuget:?package=BootGen.Core&version=2.1.5 // Install BootGen.Core as a Cake Tool #tool nuget:?package=BootGen.Core&version=2.1.5
BootGen
<img align="right" width="200px" height="85px" src="BootGenLogo.png">
Customizable code generator library for rapid application prototyping.
See a live demo at bootgen.com!
Supported Languages
C#, TypeScript, Swagger (OAS3)
How Does it Work?
From a set of sample data given JSON format BootGen will determine a data model. Using this data model and a set of Scriban templates it will generate a server and a client application.
An example set of Scriban templates can be found here.
An Example JSON Input
{
"users": [
{
"userName": "Test User",
"email": "example@email.com",
"tasks": [
//timestamps
{
"title": "Task Title",
"description": "Task description",
"isOpen": true,
"dueDate": "2021-12-30T12:00:05",
"estimatedHours": 1.5,
"priority": 1,
"tags": [
//manyToMany
{
"name": "important",
"color": "red"
}
]
}
]
}
]
}
Conventions
- Property and class names should be camelCase. Casing will be set in the generated code according to the type of file generated. In C# PascalCase will be used, in TypeScript property names will remain camelCase.
- Array names should be plural nouns, everything else should be in singular form. In the generated code the fitting plural or singular form of names will be used.
Annotations
Although comments are non-standard feature in JSON, many JSON processing libraries support it. We use them as annotations. Annotations can be placed at the beginning of arrays. Possible annotations:
timestamps
: Adds aCreated
and anUpdated
timestamp property to the class.manyToMany
: Declears that the given relation is a Many-To-Many relation, as opposed to the default One-To-Many relation.class:[name]
: Substitute[name]
with the intended name of the class. Example:
{
"users": [
{
"userName": "Test User",
"email": "example@email.com",
"friends": [
//class:user
//manyToMany
{
"userName": "Test User 2",
"email": "example2@email.com"
}
]
}
]
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
- Pluralize.NET (>= 1.0.2)
- Scriban (>= 5.4.5)
- System.CodeDom (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.