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

Deserialize response failed in the scenario of Get invoice unbilled commercial consumption line items #98

Closed
Tony-Chou opened this issue Nov 27, 2019 · 2 comments

Comments

@Tony-Chou
Copy link

Steps to reproduce

Running the code list below:
SeekBasedResourceCollection seekBasedResourceCollection = scopedPartnerOperations.getInvoices().byId("unbilled").by(BillingProvider.valueOf("ALL"), "USAGELINEITEMS", currencyCode, period, size).get();

Expected behavior

Correct response.

Actual behavior

Throw exception.

Diagnostic logs

Exception msg : Could not deserialize response. Detailed message: Cannot construct instance of java.util.LinkedHashMap (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('')\n at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: com.microsoft.store.partnercenter.models.SeekBasedResourceCollection["items"]->java.util.ArrayList[0]->com.microsoft.store.partnercenter.models.invoices.DailyRatedUsageLineItem["tags"])

Environment

JAVA JDK 1.8.0_211
Partner-Center-Java 1.15.1

@Tony-Chou
Copy link
Author

It seems the parameter of [tags] in the [items] of response is an empty string, and the code is trying to deserialize the empty string into Map<String, String> so it throws the exception.
I can temporarily fix this issue by adding:
jsonConverter.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
at com.microsoft.store.partnercenter.network.PartnerServiceClient.getJsonConverter() to ignor tit.

@ghost
Copy link

ghost commented Dec 2, 2019

@Tony-Chou thank you for reporting this issue! Currently we are working on the next release, and I have just created a pull request with a hotfix for the issue. The hope is that we can push the next release by the end of this week.

@ghost ghost closed this as completed Dec 20, 2019
This issue was closed.
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

No branches or pull requests

1 participant