Skip to content
简体中文

Configuration generator reference ​

Inputs and outputs ​

Install GeWuYou.GFramework.Game.SourceGenerators at the same version as Game in the consuming project. Include schemas/**/*.schema.json in the build inputs. Each schema produces typed configuration, a table wrapper, and registration helpers. GeneratedConfigCatalog lists the project's generated tables. Use RegisterAllGeneratedConfigTables before the initial load.

Schema keywords ​

DataExample supported constraints
Valueenum, const, not
Numberminimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf
StringminLength, maxLength, pattern, format
ArrayOne object-valued items schema, minItems, maxItems, uniqueItems, contains
ObjectadditionalProperties: false, required, minProperties, maxProperties, dependentRequired, dependentSchemas
Object compositionallOf, object conditions with if / then / else

Constrain dates, times, durations, email addresses, URIs, and UUIDs using their supported format values. Use explicit object properties and conditions for variants so the generated CLR type has a defined shape. When the build reports a diagnostic, address the schema path it identifies and rebuild.

See typed game configuration for the directory layout and YAML example.

Apache License 2.0