Open StevP116 opened 1 year ago
Update: We found a workaround by creating an instance of RestClient
and passed in a customized JsonSerializerOptions
object, then used reflection to invoke the internal DwollaClient
constructor. Even still, having a fix for this would be nice, as using reflection is not ideal.
We have been using version 5.4.0 of the Dwolla client with no issues, but when we tried to upgrade to the latest stable version (6.0.0), it seems like this bug was reintroduced.
We encountered the same deserialization error trying to hit funding-sources/{id}/balance
and convert the response content to a BalanceReponse
.
Is this known to still be an issue? Is it being addressed?
P.S. The reason we are trying to upgrade to the latest stable version is in light of Dwolla's upcoming changes involving HTTP/2. They seem to recommend updating to the latest versions of their clients to ensure we can handle their updates. It would be great if someone could comment on whether version 5.4.0 of this client is sufficient to be prepared for Dwolla's upcoming updates.
In an attempt to retrieve a transfer from sandbox, using the Dwolla
TransferResponse
model, when I hit theGET https://api.dwolla.com/transfers/{id}
endpoint, I get the followingDeserializationException
with error response:The JSON value could not be converted to System.Decimal. Path: $.amount.value | LineNumber: 0 | BytePositionInLine: 1174.
This is the JSON amount data:
The
DeserializationException
is coming from theResponseBuilder
. It is using aJsonSerializerOptions
object that isn't configured to handle quoted numbers. TheJsonSerializerOptions
that theRestClient
andResponseBuilder
are using is configured in theDwollaClient
. Therefore, I don't believe there is anything we can do on our end to remedy this issue.Seems like a pretty simple fix would be to configure the default
JsonSerializerOptions
withNumberHandling = JsonNumberHandling.AllowReadingFromString
.