CyberSource / CyberSource/cybersource-rest-client-java

ReportSubscriptionsApi not parsing the response retrieved from the API

Open
#44 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
29
Forks
50
Avg merge
28m
Merged PRs (30d)
1

Description

Hi,

I'm actually working using the cybersource rest client java and I'm working with ReportSubscriptionsApi to retrieve the Report subscriptions.

Right now I'm facing up with an issue that happens when I'm calling the rest endpoint in order to get that info. The object which should have the reports information is coming as null. I've been debugging directly the response and it is successful and as well, it matches with the response given on the documentation page using my API key and secret.

Digging into the code and doing some research, I'm looking that it may be for the GSON anotation inside that class and the response given by the webservice, seems that there is a mismatch between them.

Please check it up the info below, as you can see the object is coming as Subscriptions
"_embedded": { "Subscriptions": [ { "_links": { "self": { "href": "https://apitest.cybersource.com/reporting/v3/report-subscriptions/..." } },

And, this is on your code, inside the ReportingV3ReportSubscriptionsGet200Response class.

public class ReportingV3ReportSubscriptionsGet200Response { @SerializedName("subscriptions") private List<ReportingV3ReportSubscriptionsGet200ResponseSubscriptions> subscriptions = null;

At a glance, it seems that you're waiting for a property called "subscriptions" instead of "Subscriptions". Hence, seems that this would be a potential reason why I'm getting the report info inside of the object as null even when the call to the webservice is successful and the response is coming with data that would be parsed without issues.

Can you please reproduce and confirm if this is an issue?

Kind regards!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ReportSubscriptionsApi and ReportingV3ReportSubscriptionsGet200Response, then compare the API response's _embedded.Subscriptions property with the model's Gson mapping. Reproduce the report-subscriptions request and verify that the returned object contains the subscription data rather than null.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.