Skip to content
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

Checking on Maintenance / Would you be interested in contributing to a spec? #22

Open
TotalTechGeek opened this issue Dec 3, 2024 · 0 comments

Comments

@TotalTechGeek
Copy link

Hey there! 👋🏻

And just a heads up, pieces of this message have been copy-pasted, but I've taken a look through the source code of this project -- it's solid, and I'm reaching out to this Ruby project first because it seems to be more recently maintained.

I maintain a JSON Logic implementation in JavaScript called json-logic-engine.

I wanted to reach out and inquire:

  • Is this project still something you're interested in maintaining?
  • Would you be interested in working with a community of other JSON Logic maintainers to help develop a more rigorous specification, so we can resolve compatibility issues between implementations?

To be clear... this would be a community effort -- I've been trying to get a hold of Jeremy for a few years now, but I haven't had much success chasing him down 😅 . If he takes notice, I'd love to have him involved.

My goal though is to get a dialog going between different maintainers and build a spec + compat table so JSON Logic can be more beneficial to folks.

There are some quirks with different implementations, some ambiguities in the "spec" we have now, and some impossible behaviors that I think would be helpful for the community to address.

Examples of issues I think need discussed & spec'd:

  • Data: How do you access { '': 1 }?
  • Data: How do you access { 'hello.world': 1 }
  • Truthiness: straightforward, but a compat table might be helpful
  • How do you handle { "!": [0] } vs { "!": 0 } -- this one is more straightforward; but a common compat issue.
  • How do you handle { "!": { "var": "data" } } where data resolves to [0], is it treated like [[0]] or [0]?
  • How do you access context in iterators? {filter: [{var: 'arr'}, {'===': [{var: 'item'}, {var: '../../choice'}]}]}; explanation: In most implementations, you're unable to access above context in your iterator, so you can't use data to add numbers together, or filter things out.
  • .length, should var in JSON Logic have a dedicated handle to allow a user to fetch .length if the property does not exist on the object naturally? Most implementations do not handle this. This makes logic incompatible in between interpreters; so should .length be treated as a special path, or be given a reserved operator 😉

My hope is to get folks discussing backwards compatible approaches, and help provide resources to projects to help iron out implementation differences.

So:

  • Would you be interested in participating?
  • If not interested in the spec, would you be interested in receiving PRs based on community input?

Some Project Specific Questions

  • Do you have a straightforward way to add custom operators? I see that OPERATIONS appears to be a dictionary, is it expected that folks inject params in?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant