Source Generator Core Library Components
The REslava.Result.SourceGenerators project uses a shared Core Library infrastructure that each generator delegates to:
| Component | Purpose |
|---|---|
CodeBuilder |
Fluent API for emitting well-indented C# code (class/method declarations, XML docs, braces) |
HttpStatusCodeMapper |
Convention-based + custom error-name → HTTP status resolution |
AttributeParser |
Type-safe extraction of attribute arguments (string, bool, int, arrays) |
GeneratorConfigurationBase<T> |
Base class for generator configs: validation + deep cloning |
IncrementalGeneratorBase<T> |
Base for configuration-driven IIncrementalGenerator implementations |
Each generator (ResultToIResultGenerator, SmartEndpointsGenerator, ValidateGenerator, etc.) is a thin [Generator]-attributed wrapper that delegates to an Orchestrator → AttributeGenerator + CodeGenerator pair.