-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Go Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Context
The NewDecimal128 constructor currently accepts any 128-bit pattern and produces a Decimal128 object that could be marshaled into invalid extended JSON. This can be rather confusing to users. For example: https://go.dev/play/p/FgV82UGH3i9
Definition of done
Update NewDecimal128 to return an error if an illegal pattern would be produced by the user's h/l input.
Pitfalls
While this will help users avoid marshaling extended JSON that can't be parsed, it doesn't avoid the problem entirely. A user could get around this validation by creating the serialization directly.
- related to
-
GODRIVER-3531 Some decimal128 values can be marshaled to JSON, but can't be unmarshaled
-
- Closed
-
-
DRIVERS-3164 Investigate Decimal128 validation during Extended JSON generation
-
- Needs Triage
-