Skip to content

Conversation

@Advaitva
Copy link
Contributor

Due to the fixed index (index = 0), always the first capturing group is selected. This was creating a problem when the signature had different types parameters.

Due to the fixed index (index = 0), always the first capturing group is selected.  This was creating a problem when the signature had different types parameters.
@aeberhart
Copy link
Contributor

Dear @Advaitva, thanks for the fix. Could you please provide a unit test that shows the problem?

@Advaitva
Copy link
Contributor Author

Hi @aeberhart, please have a look at the unit test in my commit. Here are the screenshots proving the same -

Original issue -
image

With index increment fix -
image

@aeberhart aeberhart merged commit 95cf5f6 into dashjoin:main Oct 24, 2025
1 check failed
@aeberhart
Copy link
Contributor

checked against the original implementation:

                    params.forEach(function (param, index) {

we translate to

            int index = 0;
            for (Object _param : _params) {

but forgot to inc the counter. The fix changed the behaviour of com.dashjoin.jsonata.SignatureTest.testParametersAreConvertedToArrays()
in that null values are treated

the failing unit test was fixed in a subsequent commit.

Thanks @Advaitva !

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