Comments (5)
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.
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.
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.
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.
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)
- Target netstandard 2.1 HOT 6
- Doesn't properly parse for max_by HOT 1
- Nuget package should have addtional metadata HOT 2
- Add Net standard 2.1 as TFM HOT 1
- Consider implementing a dependency injection mechanism to simplify code.
- System.Text.Json support HOT 11
- netstandard1.3 HOT 3
- Bug in .NET with a number comparison HOT 3
- Array parsing does not work as expected HOT 2
- JMESPath.Net does not handle Unicode surrogate pair characters correctly.
- Behaviour issue when using `null` on the lhs of a `pipe-expression`
- Add extension point to register custom function implementation HOT 4
- lower() function uses ToLowerInvariant incorrectly
- String Slice fails with 'Index was outside the bounds of the array.' error HOT 3
- Hash is calculated each time even for comparison with Null token
- JmesPath class might not be thread-safe HOT 3
- Trim() function (and trim_left/trim_right) has state that affects next invocations
- C# Using JmesPath (1.0.308) Transform(string json, string expression) does not filter on integers when using `tick` delimiter. HOT 2
- Add async support for custom functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmespath.net.