async-stripe icon indicating copy to clipboard operation
async-stripe copied to clipboard

Serialization Error resulting from normal api usage, Invoice::retrieve, expandable

Open sjud opened this issue 1 year ago • 0 comments

Describe the bug

This line of code

   let invoice = Invoice::retrieve(&client, &invoice_id, &["charge.balance_transaction"]).await.unwrap();

panics with this error

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: JSONSerialize(Error { path: Path { segments: [Map { key: "charge" }] }, original: Error("data did not match any variant of untagged enum Expandable",

Are there circustances where this error makes sense? This code works in another part of my program, so I am not sure why it would fail with this serialization error here.

To Reproduce

I'm not sure exactly, since it isn't clearly reproducing except for in one segment of my code.

Expected behavior

For the invoice params to be serializable.

Code snippets

No response

OS

macOS

Rust version

1.63.0

Library version

async-strype 0.22.0

API version

2022-08-01 (latest)

Additional context

Not sure what is going on, any help would be much appreciated. Thanks for all of your hard work on this library, it's made my Stripe journey much easier. :)

sjud avatar Jun 27 '23 15:06 sjud