Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException on creating NotificationFilterUrlUser #117

Closed
1 of 2 tasks
victorjacobs opened this issue Jun 2, 2019 · 0 comments · Fixed by #118
Closed
1 of 2 tasks

NullPointerException on creating NotificationFilterUrlUser #117

victorjacobs opened this issue Jun 2, 2019 · 0 comments · Fixed by #118

Comments

@victorjacobs
Copy link

victorjacobs commented Jun 2, 2019

It seems that the SDK for NotificationFilterUrlUser is out of date with the API response. The Swagger states that the response for a POST to this endpoint should return:

{
  "Id": {
    "id": 0
  }
}

However when I attempt the calls manually using the ApiClient (code copy pasted around from the SDK) it seems like the endpoint returns:

{
  "Response": [
    {
      "NotificationFilterUrl": {
        "category": "MUTATION",
        "notification_target": "https://example.com/callback"
      }
    }
  ],
  "Pagination": {
    "future_url": null,
    "newer_url": null,
    "older_url": null
  }
}

Which results in the SDK exploding. More example code can be found here.

Steps to reproduce:

Create a NotificationFilterUrlUser through:

NotificationFilterUrlUser.create(listOf(NotificationFilterUrl().apply {
    category = "MUTATION"
    notificationTarget = "https://example.com/callback"
}))

What should happen:

NotificationFilterUrlUser is created.

What happens:

NullPointerException is thrown in com.bunq.sdk.model.core.BunqModel.processForId(BunqModel.java:80):

Integer responseValue = gson.fromJson(responseItemObjectUnwrapped, Id.class).getId();

SDK version and environment

  • Tested on [1.10.1]
  • Sandbox
  • Production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant