Dwolla / dwolla-v2-csharp

Official C# Wrapper for Dwolla's API
https://developers.dwolla.com
MIT License
12 stars 15 forks source link

Cannot Unset Value #42

Open dahlbyk opened 2 years ago

dahlbyk commented 2 years ago

I have a Customer that incorrectly set a DoingBusinessAs value. In trying to clear the value, the API doesn't seem to receive the null.

Guessing it's due to: https://github.com/Dwolla/dwolla-v2-csharp/blob/e4d781b88a6bcc9c7bae989470cbbfa16d83ca5f/Dwolla.Client/DwollaClient.cs#L41

That was added in 0d02518c979374d2a13236319f8b333543058436, but doesn't seem linked to any particular public issue. Unclear if it's actually necessary for proper functioning of the SDK.

Three suggestions:

  1. Remove that and see what breaks.
  2. Allow overriding JsonSettings either globally or per client/request.
  3. Annotate optional properties like DoingBusinessAs with [JsonProperty(NullValueHandling = NullValueHandling.Include)]