You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DraftPaymentCreate - Serialization of Pointer object - throws Token PropertyName in state Property would result in an invalid JSON object. when using custom JsonConverter<T>
#138
/// <summary>/// Custom (de)serialization of MonetaryAccountReference required to provide compatibility between the two types/// used to refer to Monetary Accounts: Pointers in requests and Monetary Account Labels in responses./// </summary>publicclassMonetaryAccountReferenceConverter:JsonConverter{publicoverridevoidWriteJson(JsonWriterwriter,objectvalue,JsonSerializerserializer){varmonetaryAccountReference=(MonetaryAccountReference)value;if(monetaryAccountReference==null||monetaryAccountReference.Pointer==null){writer.WriteNull();}else{writer.WriteRawValue(BunqJsonConvert.SerializeObject(monetaryAccountReference.Pointer));}}publicoverrideobjectReadJson(JsonReaderreader,TypeobjectType,objectexistingValue,JsonSerializerserializer){varjObject=JObject.Load(reader);varlabelMonetaryAccount=BunqJsonConvert.DeserializeObject<LabelMonetaryAccount>(jObject.ToString());returnnewMonetaryAccountReference(labelMonetaryAccount);}publicoverrideboolCanConvert(TypeobjectType){returnobjectType==typeof(MonetaryAccountReference);}}
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
What should happen:
What happens:
Extra info:
[//]: # https://stackoverflow.com/questions/54441810/token-propertyname-in-state-property-would-result-in-an-invalid-json-object-whe
Error is located in BunqSdk/Json/MonetaryAccountReferenceConverter.cs
should be changed to
Like below
The text was updated successfully, but these errors were encountered: