2.60.0

(feat): Add opt-in enable-inline-types configuration option. When enabled, types marked as inline in the API definition are generated as nested classes inside a static Types class on the parent type, instead of as separate top-level files.

For example, given a User type with an inline Address property, the generated C# looks like:

1public record User
2{
3 public required Types.Address Address { get; set; }
4
5 public static class Types
6 {
7 public record Address
8 {
9 public required string Street { get; set; }
10 public required string City { get; set; }
11 }
12 }
13}

All type shapes are supported: objects, enums, discriminated unions, and undiscriminated unions. Recursive nesting works (e.g. User.Types.Address.Types.Coordinate), and collision avoidance renames the nested class to InnerTypes if the parent already has a Types property.

1generators:
2 - name: fernapi/fern-csharp-sdk
3 config:
4 enable-inline-types: true

2.31.1

(fix): Fix CS0426 compilation error when the client class name matches a namespace root segment (e.g., class Candid in namespace Candid.Net). The C# compiler previously resolved Candid.Net as looking for a Net member on the Candid type instead of the Candid.Net namespace. The generator now uses global:: prefixes in both inline references and using directives to disambiguate.