jsonata.net.native icon indicating copy to clipboard operation
jsonata.net.native copied to clipboard

Parent (%) operator seems not to work

Open kreadyf opened this issue 1 year ago • 7 comments

Simple example:

JSON:

{
  "Account": {
    "AccountName": "Firefly",
    "Order": {
      "test": "test"
    }
  }
}

Query: Account.Order.%.AccountName

Works in Exerciser and Javascript library.

In .Net: The symbol % cannot be used as a unary operator'

kreadyf avatar Jul 27 '23 15:07 kreadyf

Yes, for now it's not implemented, as mentioned at https://github.com/mikhail-barg/jsonata.net.native#operators

mikhail-barg avatar Aug 28 '23 14:08 mikhail-barg

I have no ETA on implementing this yet (

mikhail-barg avatar Aug 28 '23 14:08 mikhail-barg

Sorry, we read that then too. Is there a way to help out here, or is this a somewhat very complicated feature?

kreadyf avatar Sep 04 '23 18:09 kreadyf

Well, this feature was one of the reasons to create custom json parser/dom as it became clear that Json.Net is not capable of supporting this properly.

But since then I haven't got enough time and will to look through it once again. And yes, the feature it a bit complicated.

But since you are interested, I'll try to find some time for another attempt.

mikhail-barg avatar Sep 05 '23 07:09 mikhail-barg

Okay, I've made an implementation for the operator behavior. The implementation is quite different from the on in the original jsonata-js (which I hardly understand), but it passes all the tests, except 4 tests with another unsupported operators, and except another one which is kinda really weird.

I have raised an issue regarding this last test. And I'd like to wait for a feedback from original Jsonata team regarding this one, before releasing a new package version.

mikhail-barg avatar Sep 07 '23 20:09 mikhail-barg

Hi there, thank you so much - that was really quick!

kreadyf avatar Sep 08 '23 07:09 kreadyf

Published changes in v2.3.0 release. Still no answer regarding that strange issue from jsonata team.

mikhail-barg avatar Sep 10 '23 07:09 mikhail-barg