bunq / sdk_csharp

C# SDK for bunq API
MIT License
35 stars 22 forks source link

DirectorAlias model has changed in production from a single object to array of objects #137

Closed mason-chase closed 4 years ago

mason-chase commented 4 years ago

Steps to reproduce:

  1. there is a breaking change in Bunq response, Authorization via API barcode on a company account can't map it, the json response has array of objects

What should happen:

  1. Should return a Object of BunqUser

What happens:

  1. Serialization error:
    Newtonsoft.Json.JsonSerializationException: Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Bunq.Sdk.Model.Generated.Object.LabelUser' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
    To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
    Path '[2].UserCompany.director_alias', line 306, position 25.

SDK version and environment

InhouseMedia commented 4 years ago

same as: https://github.com/bunq/sdk_csharp/issues/135 there's a fix but needs to be merged

mason-chase commented 4 years ago

I cannot believe Bunq make a change to API model without updating Document or SDK Nuget , This is a breaking change, when is the nuget going to be updated?

lexym commented 4 years ago

Fixed :) https://github.com/bunq/sdk_csharp/issues/135

mason-chase commented 4 years ago

Are you putting Object back into response? We were just presenting today to client and our app went into exception error.

@Bunq Can you please decide what is your final response is going to look like? Is it going to break again?