-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Labels
Description
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