Skip to content

fix: handle empty string decimal values in Shopify API responses - #339

Merged
oliver006 merged 1 commit into
bold-commerce:masterfrom
hseinmoussa:fix/handle-empty-decimal-strings
Apr 4, 2026
Merged

fix: handle empty string decimal values in Shopify API responses#339
oliver006 merged 1 commit into
bold-commerce:masterfrom
hseinmoussa:fix/handle-empty-decimal-strings

Conversation

@hseinmoussa

Copy link
Copy Markdown

Shopify API sometimes returns empty strings ("") for optional decimal fields like flat_modifier on CarrierShippingRateProvider. The shopspring/decimal library cannot parse empty strings, causing unmarshalling to fail.

Introduces FlexDecimal type that wraps *decimal.Decimal and gracefully handles null, empty strings, and valid decimal values.

Shopify API sometimes returns empty strings ("") for optional decimal
fields like flat_modifier on CarrierShippingRateProvider. The
shopspring/decimal library cannot parse empty strings, causing
unmarshalling to fail.

Introduces FlexDecimal type that wraps *decimal.Decimal and gracefully
handles null, empty strings, and valid decimal values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@oliver006 oliver006 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@oliver006
oliver006 merged commit 4c24616 into bold-commerce:master Apr 4, 2026
3 checks 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.

2 participants