Gregory Goijaerts The API uses a "Response" object which contains a single array of one or more objects. So that other data can be sent alongside it when required.
That's fine behaviour, but you're still missing my point. The docs promise to return one single object, like this:
{
"Id": { the-id },
"Token": { the-token-object },
"ServerPublicKey": { the-server-pubkey-object }
}
but the API returns a list of objects, like this:
[
{"Id": { the-id }},
{"Token": { the-token-object }},
{"ServerPublicKey": { the-server-pubkey-object }
]
So instead of returning a single object, it returns a list of three separate objects that must somehow be combined into the single object promised by the documentation. Note that I'm not the only one who sees an issue with this (https://together.bunq.com/d/11188-ogkevin-go-bunq-a-golang-bunq-sdk/7).
I don't care much about it being contained inside a Response
key (although that was unexpected and undocumented too), because that's very easy to handle. To get the object merging to work in Golang, however, I had to jump through different hoops.