recurly / recurly-client-python

Recurly Python Client
https://developers.recurly.com
MIT License
92 stars 78 forks source link

Unexpected/undocumented field `billing_info_id` being returned for `Subscription` resource #460

Open food-spotter opened 3 years ago

food-spotter commented 3 years ago

Describe the bug

Unexpected/undocumented field billing_info_id returned for the Subscription Resource in v2019-10-10 of the API.

It is also not described in the Subscription schema/data-model - https://github.com/recurly/recurly-client-python/blob/master/recurly/resources.py#L1392

To Reproduce

pages = self.client.list_subscriptions(
    sort="updated_at", order="asc", limit=200, begin_time=begin_from.isoformat()
).pages()

for page in pages:
    for subscription in page:
        print(subscription.billing_info_id)

Expected behavior

This field should not be returned (thus raise an Error in the above example) since it is not part of the documented list of fields - https://developers.recurly.com/api/v2019-10-10/#operation/get_subscription

Your Environment

douglasmiller commented 3 years ago

Thank you for taking the time to create this issue, @food-spotter

The billing_info_id is actually a new field that was just added to Recurly API, but hasn't been released in the client libraries (that should be happening today). The developer hub receives updates following the client libraries.

Were you experiencing any issues caused by the presence of the billing_info_id in the response without direct support existing in the client?

food-spotter commented 3 years ago

Hi @douglasmiller , That's correct. We were experiencing an issue due to the sudden occurance of this unexpected field being returned by the python-client.

We do some response validation and and this unexpected field raised an issue on our side.

Although we've made changes on our local code to now ignore unexpected fields so this issue is no longer a blocker, I do believe the python-client should only return the expected fields as specified by the API doc.