Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix expressions with constants ending in "." fail to compile #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mvandergrift
Copy link

We encountered a problem where any expression containing a constant ending in a dot followed by another value fails to compile. A simple example would be:

{
    "key1": "value1.",
    "key2": "value2"
}

This fails to compile complaining about a missing brace. Removing the "." in value1 fixes the issue.

It looks like the replaceQuotesAndCommentsInPaths function uses a regex to replace the double quotes with backticks on the JSONata path. replaceQuotesAndCommentsInPaths returns:

{
    "key1": "value1.`,
    `key2": "value2"
}

My proposed change modifies the regex to avoid this while still handling the quote replacement. I'm not 100% sure of the intent of the original code, so if I'm missing something, I'm happy to keep working on this.

@tbal999
Copy link
Member

tbal999 commented Nov 28, 2024

needs a test case

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