οΈ Pipeline Registry Generator (v1.50.0)
Both REslava.Result.Flow and REslava.ResultFlow now emit an additional always-on generated file alongside the existing *_Flows.g.cs:
obj/Generated/.../OrderService_PipelineRegistry.g.cs
For every class that has at least one [ResultFlow] method, the generator produces a companion {ClassName}_PipelineRegistry partial class with two constants per method:
// List of all pipeline method names in this class
public const string _Methods = "[\"PlaceOrder\",\"CancelOrder\"]";
// Rich metadata per method β parse with JsonSerializer.Deserialize
public const string PlaceOrder_Info = "{\"returnType\":\"Order\",\"nodeCount\":5,\"nodeKinds\":[\"Root\",\"Bind\",\"Gatekeeper\",\"Tap\",\"Terminal\"],\"errorTypes\":[\"ValidationError\",\"NotFoundError\"],\"hasDiagram\":true,\"sourceLine\":42}";
public const string CancelOrder_Info = "{\"returnType\":\"Result\",\"nodeCount\":3,\"nodeKinds\":[\"Root\",\"Gatekeeper\",\"Terminal\"],\"errorTypes\":[\"NotFoundError\"],\"hasDiagram\":true,\"sourceLine\":78}";
Usage:
// Read all pipeline names
var methods = JsonSerializer.Deserialize<string[]>(OrderService_PipelineRegistry._Methods)!;
// Read metadata for a specific method
var info = JsonSerializer.Deserialize<JsonElement>(OrderService_PipelineRegistry.PlaceOrder_Info);
int nodeCount = info.GetProperty("nodeCount").GetInt32(); // 5
string returnType = info.GetProperty("returnType").GetString()!; // "Order"
_Info JSON fields:
| Field | Type | Description |
|---|---|---|
returnType |
string |
Inner T from Result<T> / Result<T,TError> β "void" for non-generic |
nodeCount |
int |
Number of rendered pipeline nodes |
nodeKinds |
string[] |
Ordered node-kind names (Root, Bind, Gatekeeper, Tap, Terminal, β¦) |
errorTypes |
string[] |
Distinct error type names extracted from the pipeline |
hasDiagram |
bool |
true when a *_Flows.g.cs companion constant also exists |
sourceLine |
int |
1-based line number of the [ResultFlow] method declaration |
To disable registry generation for a specific project, add to its .csproj:
<PropertyGroup>
<ResultFlowRegistry>false</ResultFlowRegistry>
</PropertyGroup>