open-policy-agent/opa

to_number built-in function should accept values prefixed with '+'

sikehish opened this issue · 2 comments

Short description

opa eval -f pretty --strict-builtin-errors 'to_number("42")'
42

While it accepts 42, it doesn't accept it when an explicit '+' sign is added like in the case below:

opa eval -f pretty --strict-builtin-errors 'to_number("+42")'
json: invalid number literal "+42"

This should ideally not be the case and it should pass through. The issue is related to JSON marshalling.

@anderseknert Shall I proceed with resolving it? Let me know if any changes are to be made in the above issue description :)

Go ahead 👍