mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
0b94dd873e
This was originally added to allow Regal to get a serialized AST that included location data wherever that was possible. Regal is however no longer using OPA's JSON serialization but its own custom encoder. Attaching these options to every AST node and term comes with a cost attached, and without any known users of this feature vs. the many users who care about resource utilization, this feels like an easy choice. While it seems unlikely to be users depending on this functionality — in case someone needs it, the options for serializing AST nodes to JSON can now be set globally instead. Global state is always awkward, but since JSON marshalling methods only have access to the node being marshalled and of course, global state, there's not a whole lot of options if we intend to keep this feature. Signed-off-by: Anders Eknert <anders@styra.com>