-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve handling of numeric values in AST and storage #473
Comments
OPA should handle different numeric types gracefully. Currently, OPA will barf if its given float/int types instead of json.Number. OPA should ingest float/int types wherever possible. If ingestion would cause problems, OPA should better error messages and include clear documentation about how callers can supply json.Number values. |
tsandall
added a commit
to tsandall/opa
that referenced
this issue
Nov 28, 2017
In the past, callers have tried to load JSON data without using json.Number. These changes should make it easier for callers to supply native Go values as int64, float64, and int will be converted automatically. Also, add a case for map[string]string which is used inside of projects like Istio to represent generic key/value collections. Fixes open-policy-agent#473
tsandall
added a commit
that referenced
this issue
Nov 28, 2017
In the past, callers have tried to load JSON data without using json.Number. These changes should make it easier for callers to supply native Go values as int64, float64, and int will be converted automatically. Also, add a case for map[string]string which is used inside of projects like Istio to represent generic key/value collections. Fixes #473
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the ast, InterfaceToValue() claims to "converts a native Go value x to a Value" however, json.Number is not a Go value, and this prevents using something like fathil/structs to store objects when using opa as a library.
The text was updated successfully, but these errors were encountered: