Validate raw-bit Decimal128 constructor to reject illegal patterns

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Unknown
    • 3.0.0
    • 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.

              Assignee:
              Unassigned
              Reporter:
              Preston Vasquez
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: