Skip to content

Parse LedgerItem.amount from JSON string#21

Merged
abunsen merged 1 commit intomainfrom
fix-ledger-amount-decimal
Apr 15, 2026
Merged

Parse LedgerItem.amount from JSON string#21
abunsen merged 1 commit intomainfrom
fix-ledger-amount-decimal

Conversation

@abunsen
Copy link
Copy Markdown
Contributor

@abunsen abunsen commented Apr 15, 2026

Rails serializes BigDecimal as a JSON string (e.g. "-49.0") to preserve precision, but the SDK typed LedgerItem.Amount as a raw decimal, causing GetLedgerItemsAsync to throw JsonException on real API responses. Adds JsonNumberHandling.AllowReadingFromString so the property reads both number and string forms, plus a test covering the string case.

Rails serializes BigDecimal as a JSON string (e.g. `"-49.0"`) to
preserve precision, but the SDK typed `LedgerItem.Amount` as a raw
decimal, causing `GetLedgerItemsAsync` to throw JsonException on
real API responses. Adds `JsonNumberHandling.AllowReadingFromString`
so the property reads both number and string forms, plus a test
covering the string case.
@abunsen abunsen merged commit f01a773 into main Apr 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant