Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions fern/products/sdks/overview/csharp/changelog/2026-01-27.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
## 2.19.0
**`(feat):`** Add support for type-safe undiscriminated unions with the new `use-undiscriminated-unions` configuration option.

Undiscriminated unions provide a clean, type-safe way to work with values that can be one of several types:

```csharp
// Creating union values
var response = MyUnion.FromString("hello");
var response = MyUnion.FromInt(42);
var response = MyUnion.FromCustomObject(new CustomObject { ... });

// Type-safe value access with Is* properties and As* methods
if (response.IsString)
{
string value = response.AsString();
Console.WriteLine($"Got string: {value}");
}
else if (response.IsInt)
{
int value = response.AsInt();
Console.WriteLine($"Got integer: {value}");
}

// Safe extraction with TryAs* pattern (no exceptions)
if (response.TryAsCustomObject(out var obj))
{
Console.WriteLine($"Got object: {obj.Name}");
}
```

This provides better IntelliSense support and compile-time safety compared to working with generic `object` types.


**`(chore):`** Reduce NuGet package dependencies. The OneOf library is no longer required when undiscriminated unions are not used,
resulting in smaller package sizes and fewer transitive dependencies.


## 2.18.1
**`(fix):`** While most `<`s and `>`s should be escaped to `&lt;` and `&gt;` to avoid mangling the output,
genuine XML/HTML tags should be kept as-is; this commit scans for potential valid tags and
Expand Down