1.9.10
(feat):
Add partial JsonOptions.ConfigureJsonSerializerOptions
method to allow SDK maintainers to configure the JsonSerializerOptions
used by the SDK.
(feat):
Add partial JsonOptions.ConfigureJsonSerializerOptions
method to allow SDK maintainers to configure the JsonSerializerOptions
used by the SDK.
(feat):
Add support for Auto Pagination.
When enabled, the endpoint methods will return a Pager<T>
object that you can use to iterate over all items of an endpoint.
Additionally, you can use the Pager<T>.AsPagesAsync
method to iterate over all pages of an endpoint.
The SDK will automatically make the necessary HTTP requests for you as you iterate over the items or the pages.
(feat):
Add support for idempotency headers.
(feat):
Set Content-Type header for HTTP requests when specified in the API spec/definition.
(feat):
Copy the csproj Version as the AssemblyVersion and FileVersion.
(feat):
Generate a ProjectName.Test.Custom.props file for you to configure any MSBuild properties for your test project.
(feat):
Only import ProjectName.Custom.props and ProjectName.Test.Custom.props if the file exists, so you can delete the file if you wish to.
(fix):
Do not re-import the .NET SDK inside of ProjectName.Custom.props.
(feat):
Generate a ProjectName.Custom.props file for you to configure any MSBuild properties for your project.
(fix):
Generate the license NuGet properties inside the .csproj file correctly.
(chore):
Update System.Text.Json
dependency from 8.0.4
to 8.0.5
because a security patch was released to resolve this vulnerability.
(feat):
Add support for calling HTTP endpoints and gRPC endoints within the same service.
(feat):
Add forward-compatible enums. Set experimental-enable-forward-compatible-enums
to true
in the configuration to generate forward-compatible enums.
With forward-compatible enums you can create and parse an enum value that is not predefined.
Value
property to get the string value of the enum. - For each value in the enum,
Values
class with the string value of the enum.Here’s a before and after for creating and parsing a resource with a predefined enum value and a custom enum value:
Before:
csharp var resource = client.CreateResource(new Resource { Id = "2", EnumProperty = MyEnum.Value2 } ); // The line below does not compile because the enum does not have a `Value3` value. // resource = client.CreateResource(new Resource { Id = "3", EnumProperty = MyEnum.Value3 } ); resource = client.GetResource("3"); switch(resource.EnumProperty) { case MyEnum.Value1: Console.WriteLine("Value1"); break; case MyEnum.Value2: Console.WriteLine("Value2"); break; default: // this will never be reached until the SDK is updated with the new enum value Console.WriteLine("Unknown"); break; } if(resource.EnumProperty == MyEnum.Value1) { Console.WriteLine("Value1"); } else if (resource.EnumProperty == MyEnum.Value2) { Console.WriteLine("Value2"); } else { // this will never be reached until the SDK is updated with the new enum value Console.WriteLine("Unknown"); }
No exception is thrown, but the output incorrectly shows Value1
because .NET falls back to the first value in the enum.
After: