Create a new bunq json file as a company (UserCompany) using ApiContext::create(.... Using your existing one will not produce the error, since the node billing_contract causing it, is probably not in your json file yet.
Run a command to the API. This uses your existing ApiContext by using ApiContext::restore(...
Using this restore() will create an error:
Argument 1 passed to bunq\Model\Core\BunqModel::createFromResponseArray() must be of the type array, null given, called in ...vendor/bunq/sdk_php/src/Model/Core/BunqModel.php on line 254
What should happen
Return an empty array for the field billing_contract of UserCompany instead of a null value.
What happens:
In your newly created bunq json file is a node called billing_contract like so:
"billing_contract": [
null,
null,
null
],
Since this is null, the the parser prompts an error resulting in an unusable API.
Steps to reproduce:
ApiContext::create(...
. Using your existing one will not produce the error, since the nodebilling_contract
causing it, is probably not in your json file yet.ApiContext::restore(...
restore()
will create an error:What should happen
billing_contract
of UserCompany instead of a null value.What happens:
billing_contract
like so:Since this is null, the the parser prompts an error resulting in an unusable API.
SDK version and environment
Dirty workaround
billing_contract
node in your production json and this will work again...