JSON Reduce Reference

The JSON Reduce expression language provides a way to encode expressions which can be evaluated to JSON types, in JSON itself, in a relatively natural manner. It is similar to LISP S-expressions and the JSON script language designed by OpenWrt procd maintainers. However, it has the following differences from both:

  • expressions have no side effects;
  • there are no exceptions: failing expressions reduce to null instead;
  • subexpressions can be and actually are evaluated in an unspecified order, depending on the availability of data to process and possibly on external policies as well;
  • partially evaluated expressions can be passed along to hide details of the initial expression which the receiver need not, or must not, know about;
  • expressions can be written in a way suitable for automated metaprocessing into e.g. a subset of natural language.
  • it is by itself very simple; most useful features are expected to be supplied by applications.

The main use of JSON Reduce expressions is in evaluating DLI type description traits, constraints and access settings.