Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

BankConnection.owners: JSONObject["owners"] is not a JSONArray #235

@ChristianSch

Description

@ChristianSch

For the testBank (id 277672) the BankConnection object fails for the owners attribute because it's null instead of an empty list.

// FinApiBankConnection, FinApiOwner are my own classes
bankConnection.owners().iterator().forEachRemaining(owner -> finApiBankConnection.getOwners().add(new FinApiOwner(owner)));

the response:

2019-09-04 12:39:12.177  INFO 2194 --- [nio-2368-exec-1] org.proshin.finapi.endpoint.FpEndpoint   : Response body was: {"connections":[{"id":635974,"bankId":277672,"bank":{"id":277672,"name":"FinAPI Test Bank","loginHint":null,"bic":null,"blz":"00000000","blzs":["00000000"],"loginFieldUserId":"Onlinebanking-ID","loginFieldCustomerId":null,"loginFieldPin":"PIN","isCustomerIdPassword":false,"isSupported":true,"supportedDataSources":["FINTS_SERVER"],"pinsAreVolatile":false,"location":null,"city":null,"isTestBank":true,"popularity":3,"health":100,"lastCommunicationAttempt":"2019-09-04 12:37:39.000","lastSuccessfulCommunication":"2019-09-04 12:37:39.000"},"name":null,"bankingUserId":"XXXXX","bankingCustomerId":null,"bankingPin":"XXXXX","type":"DEMO","updateStatus":"READY","categorizationStatus":"READY","lastManualUpdate":null,"lastAutoUpdate":null,"twoStepProcedures":[],"ibanOnlyMoneyTransferSupported":false,"ibanOnlyDirectDebitSupported":false,"collectiveMoneyTransferSupported":false,"defaultTwoStepProcedureId":null,"accountIds":[1019437],"owners":null,"furtherLoginNotRecommended":false}]}

the stack trace:

org.json.JSONException: JSONObject["owners"] is not a JSONArray.
	at org.json.JSONObject.getJSONArray(JSONObject.java:764) ~[json-20180813.jar:na]
	at org.proshin.finapi.bankconnection.FpBankConnection.owners(FpBankConnection.java:133) ~[finapi-java-client-0.1.73.jar:0.1.73]
	at de.redacted.services.FinApiService.importBankConnection(FinApiService.java:208) ~[main/:na]

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions