Dotnet SDK PartialUpdateUserAsync failing on API validation

Hi all,

We’re in the process of upgrading from version 5 to 6 of the Okta dotnet SDK and have come across a use case that was working in 5.x, but appears to be failing in 6.x

We’re using UserApi.PartialUpdateUserAsync() to set a single custom property, but we’re getting back a validation failure from the API along the lines of firstName and lastName are mandatory.

I’ve swapped in a faux Okta API to capture what exactly is being HTTP posted. The 5.x version posts the following payload:


But the 6.x version posts this:


So it appears the JSON serialisation of UserProfile is including null values. For completeness, the new 6.x code is as follows:

var partialUpdate = new UpdateUserRequest {Profile = new UserProfile {AdditionalProperties = new Dictionary<string, object>()}};
partialUpdate.Profile.AdditionalProperties.Add("Foo", newValue);
await _oktaUserApi.PartialUpdateUserAsync(uid, partialUpdate);

Is there a way for force null values to not be serialised?