Skip to content

feat(core/serde): add NumericValue container #1544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Mar 13, 2025

  • creates the core/serde submodule, which will later be expanded when much of serde moves from codegen to JS runtime
  • adds a NumericValue container (unused so far) for holding BigDecimal data without deciding on a numeric library on behalf of the user

This is not currently in use, but will facilitate future work on serde. It will also unify behavior related to too-large numerics. Currently there is inconsistent behavior among protocols when handling large numbers. Some make best-effort attempts to fit into Number and some throw errors disallowing large numbers. Both of those are not desirable for customers.

We should aim to preserve numeric precision in all cases without coupling to any specific numeric library. A simple string container with a type differentiator field accomplishes that.

@kuhe kuhe requested a review from a team as a code owner March 13, 2025 16:33
@kuhe kuhe merged commit 02ef79c into smithy-lang:main Mar 13, 2025
10 checks passed
@kuhe kuhe deleted the feat/serde branch March 13, 2025 21:48
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