Skip to navigation

1.16.0

(feat): Add read-only and writeable additional properties for request and response types.

Example:

var request = new FooRequest
{
Id = "123",
AdditionalProperties =
{
["extra1"] = new { value = 42 },
["extra2"] = DateTime.Now,
["extra3"] = 99
}
};
var response = await client.Foo.CreateAsync(request);
Dictionary<string, JsonElement> jsonElements = response.AdditionalProperties.ToJsonElementDictionary();
Dictionary<string, int> extra1 = jsonElements["extra1"].Deserialize<Dictionary<string, int>>();
DateTime extra2 = jsonElements["extra2"].GetDateTime();
int extra3 = jsonElements["extra3"].GetInt32();

To enable this feature, configure experimental-additional-properties: true in the config section of your C# generator in generators.yml. This will become the default in the future.