Skip to content
@json-logic

JSON Logic

A community effort to consolidate JSON Logic and develop a formal specification.

JSON Logic Community 🤝✨

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.

Why This Organization Exists 🌍

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.

Our Goals 🚀

  1. 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).
  1. Build Compatibility Resources
  • Create and maintain a compatibility table for implementations.
  • Provide a robust test suite for maintainers to validate their projects.
  1. Support JSON Logic Maintainers
  • Offer resources and community support to help resolve implementation differences.
  • Facilitate collaboration between maintainers to align on common goals.
  1. 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.
  1. Encourage Extensibility
  • Identify and spec out common extensions.
  • Release shared libraries or guidelines for extending JSON Logic.

Key Challenges We Aim to Address 🧩

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" } }, where data 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)

How You Can Help ❤️

We believe in the power of open collaboration! Here's how you can contribute:

  1. Join the Conversation
  • Participate in discussions to shape the specification and resolve ambiguities.
  1. Submit Feedback
  • Share issues, quirks, or use cases you've encountered with JSON Logic.
  1. Contribute to Resources
  • Help build the compatibility table or improve the test suite.
  1. Later on, participate in extension discussions

Get Involved! 🎉

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.

Special Acknowledgements ⭐

  • 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

Popular repositories Loading

  1. json-logic-engine json-logic-engine Public

    Construct complex rules with JSON & process them.

    JavaScript 51 11

  2. datalogic-rs datalogic-rs Public

    A fast, type-safe Rust implementation of JSONLogic for evaluating logical rules as JSON. Perfect for business rules engines and dynamic filtering in Rust applications.

    Rust 8 1

  3. .github .github Public

    Our hub for managing this initiative

Repositories

Showing 3 of 3 repositories
  • json-logic-engine Public

    Construct complex rules with JSON & process them.

    json-logic/json-logic-engine’s past year of commit activity
    JavaScript 51 MIT 11 1 2 Updated Dec 27, 2024
  • .github Public

    Our hub for managing this initiative

    json-logic/.github’s past year of commit activity
    0 Apache-2.0 0 2 1 Updated Dec 24, 2024
  • datalogic-rs Public

    A fast, type-safe Rust implementation of JSONLogic for evaluating logical rules as JSON. Perfect for business rules engines and dynamic filtering in Rust applications.

    json-logic/datalogic-rs’s past year of commit activity
    Rust 8 Apache-2.0 1 1 0 Updated Dec 20, 2024

Top languages

Loading…

Most used topics

Loading…