Open julianCast opened 3 weeks ago
Hi @julianCast, I just checked this and this looks to be returning undefined
when there's no invoice_estimate
as expected.
Could you confirm if you see the empty object when you hit the API via curl
or any other REST client?
Hi @julianCast, I just checked this and this looks to be returning
undefined
when there's noinvoice_estimate
as expected.Could you confirm if you see the empty object when you hit the API via
curl
or any other REST client?
Here's the thing. To reproduce it, I create a subscription, with a yearly plan, modify the price to 0 and after that I cancel it (end of term)
❌ Using this library node js (Got the {})
✅ Using regular HHTP in Postman (Doesn't return the attribute since is undefined)
Thanks for sharing this @julianCast. I don't seem to be able to reproduce this with the same flow & code snippet 😕
Just to be sure, is the chargebee
object in the code sample you shared coming directly from our SDK or do you have any wrapper on top? Also, is there any layer that could possibly modify the response?
Hi! Thanks for following this: Yes, I'm actually just using the SDK.
import { ChargeBee } from 'chargebee-typescript';
const chargebee = new ChargeBee();
Description of the Bug
I believe we should get null instead of { } in the cases of no invoices estimate. That object can cause trouble for notNullable fields. That would make the field
invoice_estimate.sub_total
be undefined, when it's not an optional parameter in your documentation.Steps to reproduce
Check the output for a subscription which has no next invoice, so no
invoice_estimate
Expected Behavior
Code Snippets (if applicable)
Operating System
macOS
Language version
Node 18.17.0
Library version
2.32.1
Additional context
This incurs in error if we are returning estimate via graphql where the field invoice_estimate.sub_total was set as
NonNegativeInt!
.