You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, there is an issue with the SubscriptionChangeCreate type, AddOns field. Because it is annotated with omitempty (json:"add_ons,omitempty"), the field is not being marshalled even if the array is allocated.
In the same time, simply removing omitempty would break the statement from the documentation: If this value is omitted your existing add-ons will be unaffected. By removing omitempty it'll always marshal the value, resulting in either an array of addons, an empty array (if allocated), or in null. Passing null on the endpoint raises Recurly error:
{
"error": {
"type": "validation",
"message": "Please remove the following unpermitted parameters from your request: add_ons.",
"params":[{"param":"add_ons"}]
}
}
Expected behavior
Initialized slice being marshalled and addons being removed (on renewal in my case).
Your Environment
Which version of this library are you using?
v4.48.0
Which version of golang are you using?
1.21
The text was updated successfully, but these errors were encountered:
kudrykv
changed the title
Cannot delete all addons from the subscriptions.
Cannot delete all addons from the subscriptions
Apr 22, 2024
Describe the bug
There is a subscription with a few addons. The intention is to delete all addons on renewal. To perform this action, this curl suffices:
However, there is an issue with the
SubscriptionChangeCreate
type,AddOns
field. Because it is annotated withomitempty
(json:"add_ons,omitempty"
), the field is not being marshalled even if the array is allocated.To Reproduce
In the same time, simply removing
omitempty
would break the statement from the documentation:If this value is omitted your existing add-ons will be unaffected
. By removingomitempty
it'll always marshal the value, resulting in either an array of addons, an empty array (if allocated), or innull
. Passingnull
on the endpoint raises Recurly error:Expected behavior
Initialized slice being marshalled and addons being removed (on renewal in my case).
Your Environment
v4.48.0
1.21
The text was updated successfully, but these errors were encountered: