FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Issues-79: fix each partial invoke by sergeevik · Pull Request #80 · dashjoin/jsonata-java · GitHub

Issues-79: fix each partial invoke - #80

Open
sergeevik wants to merge 2 commits into
dashjoin:mainfrom
sergeevik:fix-each-partial-invoke
Open

Issues-79: fix each partial invoke#80
sergeevik wants to merge 2 commits into
dashjoin:mainfrom
sergeevik:fix-each-partial-invoke

Conversation

Copy link
Copy Markdown
Contributor

In js array may be object with key as index
some another fix:

  • remove generic in string method. replace with toString
  • applyInner check not null before use in matcher
  • check ? when arg type is operator by toString.equals (? is char in value)
  • 2 test for each partial expression

In js array may be object with key as index
some another fix:
- remove generic in string method. replace with toString
- applyInner check not null before use in matcher
- check ? when arg type is operator by toString.equals (? is char in value)
- 2 test for each partial expression
lhs = new HashMap();
for (int i = 0; i < tempLhs.size(); i++) {
((HashMap) lhs).put(i, tempLhs.get(i));
}

sergeevik Dec 16, 2025
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe better:

var lhsNewMap =  new HashMap();
var lhsOldList = (List)lhs;
for (int i = 0; i < lhsOldList.size(); i++) {
  lhsNewMap.put(i, tempLhs.get(i));
}
lhs = lhsNewMap;

uw4 self-assigned this Dec 18, 2025
uw4 requested a review from aeberhart December 18, 2025 15:57

uw4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks + good catch!
We're reviewing this behavior of $each with list as input -
we want to clarify this with the original Jsonata maintainers, might be as well be a glitch in the original impl

sergeevik commented Jan 23, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

find some another bug caused by this fix.
fix realisation wrapped all partial expression. but need only to each (caught bug with $map function)

@uw4 @aeberhart any updates about for this bug?

memory pill for me:

json:

{
  "buildings": {
    "home": {
      "address": "home address",
      "period": "11 month on 12",
      "presentation": {
        "first": {
          "widget": {
            "data": "home widget"
          }
        }
      }
    },
    "work": {
      "address": "work address",
      "presentation": {
        "first": {
          "widget": {
            "data": "work widget"
          }
        }
      }
    },
    "vacancy": {
      "address": "vacancy address",
      "period": "1 month on 12",
      "presentation": {
        "first": {
          "widget": {
            "data": "vacancy widget"
          }
        }
      }
    },
    "old": {
      "address": "old address",
      "period": "2 month on 12",
      "presentation": {
        "first": {
          "widget": {
            "data": "old widget"
          }
        }
      }
    },
    "operation": {
      "address": "operation address",
      "period": "3 month on 12",
      "presentation": {
        "first": {
          "widget": {
            "data": "operation widget"
          }
        }
      }
    }
  }
}

and expression

$sift($.buildings, function($v, $k) { $k ~> /o/ and $v.presentation.*.widget})
                    ~> $each(?, function($v, $key) {{ $key: $sift($v.presentation, function($v, $k){ $v.widget }) }})
                    ~> $map(?, function($v){($v.*)})

not fork after this fix and not coverage by tests

Copy link
Copy Markdown
Contributor Author

I've fix the example-bug above. It's not the best solution, but I haven't come up with anything else yet. I've also added a test from my post with verification.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL