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

Enclose field names containing literals in quotes #61

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mbrehler
Copy link

@mbrehler mbrehler commented Nov 2, 2020

When creating the text representation of a path, field names that contain lexer literals (like a period ".') should be enclosed in quotes (or brackets).

The proposed fix only adds quotes if needed (as opposed to alway). This avoids changing current paths/behavior drastically since it seems no one has run into this so far.

Change-Id: Ia6e01f9b8218182aa61d3c39b16d4bfb57e4f593

mbrehler and others added 2 commits November 2, 2020 12:56
When creating the text representation of a path, field names that contain lexer literals (like a period ".') should be enclosed in quotes (or brackets).

The proposed fix only adds quotes if needed (as opposed to alway). This avoids changing current paths/behavior drastically since it seems no one has run into this so far.

Change-Id: Ia6e01f9b8218182aa61d3c39b16d4bfb57e4f593
Since the pull request for changes has not been merged, enable differentiating which jsonpath-ng is installed.

Change-Id: If42cb8aafbb79c8bc7b07a54473eb6ba8da9f50e
Change-Id: Ifb2eab1ebf9151c14b533cf13ef20707bb3ada19
@mbrehler
Copy link
Author

@michaelmior Could you please take a look at this pull request? I fixed trivial merge conflicts recently, let me know if you have other suggestions.

Copy link
Collaborator

@michaelmior michaelmior left a comment

Choose a reason for hiding this comment

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

Overall looks good. See a few minor suggested changes.

jsonpath_ng/__init__.py Outdated Show resolved Hide resolved
jsonpath_ng/jsonpath.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Revert version change, get rid of variable for literals.

Change-Id: I381d0a77c6832e96bb0c1f28afc15640c6e953f4
@michaelmior
Copy link
Collaborator

Thanks! Merged in 4c1effd

Matthias Brehler added 4 commits September 15, 2023 10:05
Change-Id: Ibdaf122bf2fcd762540dce1437373b166b97c910
Change-Id: Id767180b08a15aa6769f50dac43d09ceedf2875d
Change-Id: Id767180b08a15aa6769f50dac43d09ceedf2875d
@michaelmior
Copy link
Collaborator

Looking at this more closely, there are a couple cases that aren't handled here. For example, spaces and double quotes should be enclosed in single quotes also. Single quotes should also be escaped and then quoted.

@michaelmior michaelmior reopened this Nov 14, 2023
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