arlyon / async-stripe

Async (and blocking!) Rust bindings for the Stripe API
https://payments.rs
Apache License 2.0
445 stars 128 forks source link

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

Closed sjud closed 5 months ago

sjud commented 1 year ago

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. :)