2.15.0

(feat): Add support for explicit nullable/optional type handling with the new Optional<T> type.

When experimental-explicit-nullable-optional: true is configured in generators.yml, the SDK will use Optional<T?> for nullable optional fields, enabling three-state semantics for PATCH requests:

  • Undefined: Field not set - won’t be included in the request (leave unchanged on server)
  • Defined with null: Field explicitly set to null - will send null (clear the field on server)
  • Defined with value: Field set to a value - will send the value (update the field on server)

Example usage:

1public class UpdateUserRequest
2{
3 public Optional<string?> Name { get; set; } = Optional<string?>.Undefined;
4 public Optional<string?> Email { get; set; } = Optional<string?>.Undefined;
5}
6
7// Don't send name field (leave unchanged)
8var request1 = new UpdateUserRequest();
9
10// Set name to a value
11var request2 = new UpdateUserRequest { Name = "John" };
12
13// Clear name (send null)
14var request3 = new UpdateUserRequest { Name = null };

The Optional<T> type includes:

  • IsDefined property to check if a value is set
  • Value property to access the value (throws if undefined)
  • TryGetValue method for safe value access
  • Implicit conversion operators for ergonomic usage
  • Full JSON serialization support
  • IEquatable<Optional<T>> implementation for proper equality checks

(fix): Fix query parameter serialization to properly handle nullable struct types (DateTime?, DateOnly?, etc.) by adding .Value accessor when needed.

(fix): Improve nullable and optional type handling throughout the generator, including collection value types and type mapping.

2.14.1

(fix): When include-exception-handler: true is configured, the generated exception interceptor class now accepts ClientOptions in its constructor. This allows the interceptor to access client configuration when capturing exceptions.

2.14.0

(feat): Refactor WebSocket API code generation to use composition over inheritance.

Key changes:

  • Replace AsyncApi<T> base class with WebSocketClient internal class using composition
  • Flatten namespace from {root}.Core.Async.* to {root}.Core.WebSockets
  • Generated WebSocket clients now implement IAsyncDisposable, IDisposable, and INotifyPropertyChanged directly
  • Store Options and WebSocketClient as private fields instead of using inheritance
  • Forward Status, Connected, Closed, and ExceptionOccurred events from internal client
  • Simplify INotifyPropertyChanged to only notify for Status property changes

This refactoring improves code clarity and reduces complexity.