chargebee / chargebee-typescript

Typescript library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=typescript
MIT License
22 stars 16 forks source link

Deeply nested fields are incorrectly serialized #27

Closed gerbal closed 2 years ago

gerbal commented 2 years ago

I have a Coupon with nested attributes, which this library does not correctly encoded:

Given a coupon like:

{"item_constraints": [{"item_price_ids": ["id1"]}]}

Should be serialized as

item_constraints[item_price_ids][0]=["id1"] 

However, this library serializes this payload incorrectly

Core.encodeParams({item_constraints: [{price_item_ids: ['id1']}]})
// "item_constraints[item_price_ids][0][0]=id1"
cb-prajaktachavan commented 2 years ago

Closing this issue as its been resolved in latest release v2.6.0.

cb-prajaktachavan commented 2 years ago

Hi, You should be passing this jsonarray as string '["id1","id2"]' within single quotes as this field is not list of values.