-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting a field to null? #1954
Comments
@clement911 In the API, if you pass an empty string it will unset the string field.
This would return |
What if I want to set an empty string? |
You can't set an empty string in that case, it will just set the field to null already. This is how the API itself works, so it's not really specific to stripe-dotnet. You can not unset number of booleans with stripe-dotnet though our API rarely supports this in the first place. |
hmm ok. |
Although I'm not sure if it's a big deal in practice... |
In my experience, it's not. Most booleans are set to true or false, we rarely have a null "state". We're also moving more to enums instead to represent the "true/false/unset" state where it matters. |
Ok, thanks for the quick response. |
If I understand correctly, setting an option's property to
null
will cause the field to not be sent over the wire.If that is the case, how I can actually set a field to a null value (i.e clearing the value).
For example, if I want to clear the customer's phone number.
I can set
CustomerUpdateOptions.Phone
tonull
. But it won't be serialized at all right?Unless I'm missing something obvious here...
The text was updated successfully, but these errors were encountered: