Formatter Validator Minifier Escape / Unescape JSON ↔ String JSON ↔ YAML JSON → CSV NDJSON / JSON Lines JSON → Types JSON ↔ XML JSON Diff JSON Patch Canonicalize (RFC 8785) Schema Validator Schema Generator JSONPath Tester JWT Decoder JSON Errors Schemas More Tools
JSONTools / Schema registry / Serenity Code Generator (Sergen)
Schema registry

Serenity Code Generator (Sergen)

Serenity code generator (sergen) configuration file

sergen.jsonsergen.*.json*.sergen.json

Check your file against this schema

Opens the validator with this schema already loaded. Paste your sergen.json and it validates in your browser — nothing is uploaded.

Validate a sergen.json → View raw schema

Fields

Generated directly from the schema, following local $refs, to two levels of nesting.

Field Type Description
ExtendsstringIf specified, the settings in this file extends settings in a base file similar to tsconfig.json You can also use Sergen defaults by specifying this like "defaults@9.0.0"
RootNamespacestringThe root namespace for the target project. It is recommended to have this in sergen.json. If not there, it will be auto calculated from root namespace in CSPROJ file, or derived from project file name by removing .Web suffix. Generated
DeclareJoinConstantsbooleanIf true, generated code will declare and use jFKTable type of constants for expressions in entities
EnableGenerateFieldsbooleanIf true, it allows the use of [GenerateFields] attributes on rows, which automatically generates the fields using a source generator. This should only be used when Serenity.Pro.Coder is enabled in the project
EnableGenerateInterfacebooleanIf true, it allows the use of [GenerateInterface] attributes on handlers, which automatically generates the interface using a source generator. This should only be used when Serenity.Pro.Coder is enabled in the project
EnableRowTemplatesbooleanIf true, enables RowTemplate class generation. This should only be used when Serenity.Pro.Coder is enabled in the project. Has no effect when EnableGenerateFields is true. EnableGenerateFields should be preferred over this as RowTemplate
EndOfLinestringEnd of line character to use in generated files. If not specified, it will be auto detected from the environment. It is recommended to have "lf" for multi platform projects
one of: "LF", "CRLF"
FileScopedNamespacesbooleanIf true, generated code will use file scoped namespaces
ParseGlobalUsingsbooleanIf true, generated code will parse global usings from the current project. Default is true
IncludeGlobalUsingsarray<string>If specified, generated code will assume these usings are in global using scope
ExcludeGlobalUsingsarray<string>If specified, generated code will assume these usings are not in global using scope even if they are in global using scope
OmitDefaultSchemabooleanIf true, the default schema name, e.g. "dbo" for SQL Server won't be emitted in generated field expressions in Row.cs files. This is true by default only for MySql as in MySql schema names are actually database names
UseOriginAttributebooleanIf true, instead of using [Expression] attributes for foreign view fields, it will use Origin(nameof(jFK), nameof(FKRow.ViewField)) if the FKRow is already generated in the project. It will also use ForeignKey(typeof(FKRow)) type of
SaveGeneratedTablesbooleanIf true, generated table options like Identity, Module etc. will be saved to the Connections array in sergen.json after code generation. Default is true
ClientTypesobjectClient types code generation related configuration
ClientTypes.OutDirstringThe output directory for generated client types .cs files
ClientTypes.SourceGeneratorbooleanIf false, the client types source generator in Serenity.Pro.Coder will be disabled
MVCobjectMVC (e.g. view locations) related configuration
MVC.UseRootNamespacedeprecatedbooleanDeprecated, Sergen will always use the root namespace to avoid class name clashes
MVC.AsNamespacebooleanIf true, use namespace {RootNamespace}.MVC instead of a MVC class inside the RootNamespace. ESM helpers will also be generated in this namespace. Default is false. This is useful if to avoid class name clashes with referenced projects
MVC.InternalAccessbooleanIf true, Use internal instead of public for generated top level class (MVC/ESM)
MVC.OutDirstringThe output directory for MVC.cs
MVC.SearchViewPathsarray<string>View paths to search for, defaults to "Modules" and "Views". "ProjectName" is used instead of "Modules" if Razor SDK is used for the project, e.g. a Razor class library
MVC.StripViewPathsarray<string>Strip view paths from generated files. Defaults to "Modules", "Views". E.g. a subclass for Modules and Views won't be generated
MVC.SourceGeneratorbooleanIf false, the view paths source generator in Serenity.Pro.Coder will be disabled
ServerTypingsobjectServer typings code generation related configuration
ServerTypings.Assembliesarray<string>Assemblies for server typings generation. Specify only if Sergen can't auto determine your project output file
ServerTypings.OutDirstringThe output directory for generated server typings files. Not used for modules
ServerTypings.LocalTextsbooleanIf true, local texts will be generated
ServerTypings.ModuleReExportsbooleanIf true, module re-exports will be generated. Defaults to true
ServerTypings.ModuleTypingsdeprecatedbooleanDeprecated as only ES modules style code generation is supported now. If true, module typings will be generated. Defaults to true if you have "module" defined in tsconfig.json
ServerTypings.NamespaceTypingsdeprecatedbooleanDeprecated as only ES modules style code generation is supported now. If true, namespace typings will be generated. Defaults to true if you don't have "module" defined in tsconfig.json
ServerTypings.PreferRelativePathsbooleanIf true, generated typings will use relative paths instead of paths from tsconfig.json, e.g. "../ServerTypes/" instead of "@/ServerTypes/"
ServerTypings.SourceGeneratorbooleanIf false, the server typings source generator in Serenity.Pro.Coder will be disabled
RestoredeprecatedobjectDeprecated as Sergen no longer supports restoring static content. Sergen restore command related configuration
Restore.Includearray<string>List of files (git ignore like) to include while restoring
Restore.Excludearray<string>List of files (git ignore like) to exclude while restoring
Restore.TypingsbooleanSet false to disable namespace typings restore to typings/ folder
TSBuildobject
TSBuild.EntryPointsarray<string>List of entry point globs, default is "Modules/**/*Page.ts", "Modules/**/*Page.tsx", "Modules/**/ScriptInit.ts", "Modules/**/*.mts"
TSBuild.SourceGeneratorbooleanShould the list of entry points, e.g. ESM be generated, only available with Serenity.Pro.Coder
ConnectionsarrayList of connections. It is only needed when it is desired to work / generated code based on a connection string that is not in appsettings.json
KDiff3PathdeprecatedstringDeprecated. Path to KDiff3 executable. If not specified, it will be auto detected from the environment
TSCPathdeprecatedstringDeprecated. Full path to TypeScript compiler. It is assumed to be in path if not specified
BaseRowClassesarrayList of base row classes to be used instead of Row. They are matched by list of base properties
ForeignFieldSelectionstringThe set of foreign fields to generate, default is NameOnly. None: Don't generate any foreign view fields except the ones explicitly included via IncludeForeignFields All: Generate all the foreign view fields, except ones excluded
one of: "None", "All", "NameOnly"
IncludeForeignFieldsarray<string>A list of foreign fields to include in generated code. This could be used to include some additional fields This could be used to include some additional fields. Not so useful if ForeignFieldSelection is All
RemoveForeignFieldsarray<string>A list of foreign fields to omit from generated code. This could be used to disable generating code for join fields like CreatedBy, ModifiedBy etc, so properties like CustomerCreatedBy, CustomerModifiedBy etc. won't be generated in
CustomTemplatesstringThe location of custom templates folder. The files in this folder will override the default scriban templates in Sergen. You may also include additional files to be generated. Their names must match the names at
CustomGenerateobjectThe relative paths of custom generated files
CustomSettingsobjectCustom settings to be passed to and used in custom templates
AppSettingFilesarray<string>The list of appsettings.json files in order. Default is appsettings.json, appsettings.machine.json
UpgradeInfoobjectThe upgrade / migration related information used by stargen to determine the base version of template used, and already applied upgrades
UpgradeInfo.InitialTypestringInitial type of project. Available options are "Community" e.g. Serene, "Premium" e.g. StartSharp
one of: "Community", "Premium"
UpgradeInfo.InitialVersionstringVersion this project is created from. Used to determine which migrations should be applied to project (starting from)
UpgradeInfo.AppliedUpgradesarray<string>List of already applied upgrades if any

What we found in this schema

Specification sections for the keywords in this schema

Keyword Document Section
$idJSON Schema Core, draft 2020-12§8.2.1 — The "$id" Keyword
$refJSON Schema Core, draft 2020-12§8.2.3.1 — Direct References with "$ref"
$schemaJSON Schema Core, draft 2020-12§8.1.1 — "$schema"
additionalPropertiesJSON Schema Core, draft 2020-12§10.3.2.3 — "additionalProperties"
anyOfJSON Schema Core, draft 2020-12§10.2.1.2 — "anyOf"
deprecatedJSON Schema Validation, draft 2020-12§9.3 — "deprecated"
descriptionJSON Schema Validation, draft 2020-12§9.1 — "title" and "description"
enumJSON Schema Validation, draft 2020-12§6.1.2 — "enum"
itemsJSON Schema Core, draft 2020-12§10.3.1.2 — "items"
minLengthJSON Schema Validation, draft 2020-12§6.3.2 — "minLength"
patternJSON Schema Validation, draft 2020-12§6.3.3 — "pattern"
propertiesJSON Schema Core, draft 2020-12§10.3.2.1 — "properties"
requiredJSON Schema Validation, draft 2020-12§6.5.3 — "required"
typeJSON Schema Validation, draft 2020-12§6.1.1 — "type"
uniqueItemsJSON Schema Validation, draft 2020-12§6.4.3 — "uniqueItems"

Documents

Attribution

This schema comes from SchemaStore, distributed under the Apache License 2.0. Copyright 2015–present Mads Kristensen and contributors. View the original file. The field table and audit on this page are generated by JSONTools.tools; the schema itself is unmodified.

← All schemas