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

ListEntitlements method fails to deserialize the response data #853

Open
jweber opened this issue Nov 7, 2024 · 0 comments
Open

ListEntitlements method fails to deserialize the response data #853

jweber opened this issue Nov 7, 2024 · 0 comments
Labels

Comments

@jweber
Copy link

jweber commented Nov 7, 2024

Describe the bug

When calling the ListEntitlements method, the client returns a Pager<Entitlements> instead of a Pager<Entitlement> object. This causes improper deserialization of the response and fails to return the Entitlement data for an Account.

To Reproduce

Create an Entitlement, and have it assigned to an Account.

var entitlementPager = client.ListEntitlements("code-...");
var page = entitlementPager.FetchNextPage();
// See that `page.Data` is a `List<Entitlement>`, and that list does not contain the expected Entitlement

Taking the RawResponse of the page, we can manually deserialize it into a Pager<Entitlement> and successfully retrieve the data.

var raw = page.GetResponse().RawResponse;

var restResponse = new RestResponse
{
    Content = raw
};

var deserialized = JsonSerializer.Default.Deserialize<Pager<Recurly.Resources.Entitlement>>(restResponse);

Expected behavior

The client correctly deserializes the response from the API.

Your Environment

  • Which version of this library are you using? 4.58.0
@jweber jweber added the bug? label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant