Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-3541

Validate raw-bit Decimal128 constructor to reject illegal patterns

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown 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 Unassigned
            Reporter:
            preston.vasquez@mongodb.com Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: