Coder Social home page Coder Social logo

Comments (5)

adrianignat13 avatar adrianignat13 commented on September 28, 2024 1

Let's say I have an app that lets the user build the JMESPath query. (ex: filter emails based on a defined expression). I then need to pass this query to another service that will interpret the query and do something with it (ex: get all emails and send me just the ones that match the filter). The service can be written in another language (js, java, etc).
If I can translate the .net expression into the JMESPath string then it can be interpreted by any app written in any language using the JMESPath library for that specific language.

from jmespath.net.

jdevillard avatar jdevillard commented on September 28, 2024 1

Hello @eduard-dumitru ,

I'm not aware of this, but I think it will not be too difficult to implement some visitor pattern to transform the JmesPathExpression to it representative string.

I'll think on how we can implement this kind of feature, but I've to check to see if this could be develop as an extension to the library of if we should keep this feature inside this lib.

We're (with @springcomp) currently working on the specification of JMESPath to enhance capability of all the library but I'll take a look on this subject asap. (at least to suggest a PoC)

from jmespath.net.

jdevillard avatar jdevillard commented on September 28, 2024

Hello ,

I don't really understand why you'll need to write a c# expression and then convert it to the jmespath string representation and then be able to use this string expression in other librairies ?

Jmespath implementation was based on jmespath specification, so if the library is compliant , any jmespath string will done the same result on different librairies .

But maybe I m missing something about your need

from jmespath.net.

eduard-dumitru avatar eduard-dumitru commented on September 28, 2024

Hi @jdevillard,

I want to create an app where users will graphically create trees of JmesPathExpression.
They would have the ability to attach nodes to the tree by replacing leaves with other subtrees.

Finally, I would like the app to produce the associated JMESPath query as a string.

Are you aware of any already implemented way of using your JmesPathExpression hierarchy and getting a ToJMESString add-on on top?

from jmespath.net.

eduard-dumitru avatar eduard-dumitru commented on September 28, 2024

I'm thinking about privately implementing this exact visitor pattern you mentioned on top of your excellent library.

TL;DR
Would you accept a PR should it be deemed considerate enough?
I'd create a secondary CSPROJ + classlib + NuGet package or I'd host everything inside the main triplet.

I understand the decision can be challenging since it's binding later.
I'm just trying my luck here :).

The issues I already see are:

  • your hierarchy's classes' fields are non-public - I'd have to use reflection. I could circumvent the performance hit via Reflection.Emit, but it's smelly.

  • I'd have to maintain this private library - whenever the specification evolves, and you release a new library, I'd have to keep up

  • the specification's evolution is one thing. I'd have to support new expression types when they come up constantly
    but specification aside, the NuGet package maintainer could decide to shift the internal mechanics for practical reasons - you didn't break a contract if you were to do that

  • I think there are >0 users out there who could benefit from such a feature. It would be a shame for it to live in forks / binary integrated via Reflection in private repos.

from jmespath.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.