Welcome to the JSON Logic Community! Our mission is to foster collaboration among maintainers and users of JSON Logic implementations across platforms to develop a more rigorous specification, promote compatibility, and provide resources that make JSON Logic more robust and beneficial to everyone.
Many productivity applications require a way to serialize and define filters and sandbox application capabilities, and many folks end up rolling their own implementations.
JSON Logic has become a reasonably well-used standard for expressing conditional logic in a portable & embeddable format.
With time, inconsistencies and ambiguities have emerged between different implementations, making it challenging for developers to rely on JSON Logic across platforms.
Developing a standard specification and robust test suite will ideally make JSON Logic easier to adopt; and empower developers further.
- Develop a Rigorous Specification
- Address ambiguities and inconsistencies in the current spec.
- Define behaviors for edge cases (e.g., truthiness, accessing empty keys and keys with separators in them).
- Build Compatibility Resources
- Create and maintain a compatibility table for implementations.
- Provide a robust test suite for maintainers to validate their projects.
- Support JSON Logic Maintainers
- Offer resources and community support to help resolve implementation differences.
- Facilitate collaboration between maintainers to align on common goals.
- Improve AST Use Cases
- JSON Logic is a surprisingly solid & minimal AST; we should enable that!
- By exploring it as an AST, it could become a solid back-end for future specifications or embedded grammars.
- Encourage Extensibility
- Identify and spec out common extensions.
- Release shared libraries or guidelines for extending JSON Logic.
Here are some examples of challenges we’re working on:
- Accessing keys like
{ '': 1 }
or{ 'hello.world': 1 }
. - Truthiness quirks, such as
{ "!": [0] }
vs{ "!": 0 }
; and{ "!": { "var": "data" } }
, wheredata
is an array. - Handling iterator contexts (e.g., accessing parent context in filter operations).
- Defining behaviors for .length and similar properties in var operations. (a
length
operator is likely preferable) - Aligning on reserved operators and backwards-compatible extensions.
- How to embed data in logic, and what is interpreted as data vs logic.
- There also just tend to be quirks between different implementations (auto-flattening of arrays, single-argument parameters)
We believe in the power of open collaboration! Here's how you can contribute:
- Join the Conversation
- Participate in discussions to shape the specification and resolve ambiguities.
- Submit Feedback
- Share issues, quirks, or use cases you've encountered with JSON Logic.
- Contribute to Resources
- Help build the compatibility table or improve the test suite.
- Later on, participate in extension discussions
Whether you’re a project maintainer, developer, or JSON Logic enthusiast, we’d love to have you onboard!
We'd also love to have volunteers willing to adopt abandoned implementations.
- Jeremy Wadhams for inventing JSON Logic
- The OpenFeature Team as one of the biggest public users of cross-library JSON Logic, and for their willingness to back this initiative
- Adam Parry for the Vulcan Salute used in the JSON Logic logo