Skip to content

Conversation

@TamasSzigeti
Copy link
Contributor

@TamasSzigeti TamasSzigeti commented Nov 21, 2025

Q A
Branch? 7.3
Bug fix? yes
New feature? no
Deprecations? no
License MIT

Bumped into this when parsing Kubernetes json output where "True" is commonly used and JsonPath threw for this valid expression. Making the regex more strict fixes it.

See also PR for upstream fixtures

@carsonbot carsonbot added this to the 7.3 milestone Nov 21, 2025
@carsonbot carsonbot changed the title Fix JsonPath throwing on quoted True/False/Null Fix JsonPath throwing on quoted True/False/Null Nov 21, 2025
@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

@alexandre-daubois alexandre-daubois changed the title Fix JsonPath throwing on quoted True/False/Null [JsonPath] Fix throwing on quoted True/False/Null Nov 21, 2025
@alexandre-daubois
Copy link
Member

I see that you added tests in cts.json. This file is extracted from another repo maintaining the compliance test suite. If these tests were actually added to the repo, nothing more to do on this side 🙂 However, if these are new test cases you came up with, you should better add new separate unit tests. Otherwise, they may be overwritten if we update cts.json with a new version of the external repository.

@stof
Copy link
Member

stof commented Nov 21, 2025

I would suggest submitting those new tests upstream in https://github.com/jsonpath-standard/jsonpath-compliance-test-suite/ as they might be valuable to other implementations of the standard.

@TamasSzigeti
Copy link
Contributor Author

Hah I just moved it to unit tests, will go back then

@TamasSzigeti
Copy link
Contributor Author

@alexandre-daubois @stof Done, btw there are 2 (unrelated) test cases upstream which now fail here when we update the json:

1) Symfony\Component\JsonPath\Tests\JsonPathComplianceTestSuiteTest::testComplianceTestCase with data set "functions, length, non-singular query arg, multiple index selectors" ('$[?length(@[1, 2])<3]', array(), array(), true)
Failed asserting that exception of type "Symfony\Component\JsonPath\Exception\JsonCrawlerException" is thrown.

2) Symfony\Component\JsonPath\Tests\JsonPathComplianceTestSuiteTest::testComplianceTestCase with data set "functions, length, non-singular query arg, multiple name selectors" ('$[?length(@['a', 'b'])<3]', array(), array(), true)
Failed asserting that exception of type "Symfony\Component\JsonPath\Exception\JsonCrawlerException" is thrown.

@alexandre-daubois
Copy link
Member

Thanks for taking care of the upstream change! I'll have a look at the failing test with the updated set.

@alexandre-daubois
Copy link
Member

It has been merged upstream. Can you update the cts.json file (if needed) with the new version please?

@TamasSzigeti
Copy link
Contributor Author

It has been merged upstream. Can you update the cts.json file (if needed) with the new version please?

Done

Copy link
Member

@alexandre-daubois alexandre-daubois left a comment

Choose a reason for hiding this comment

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

Thank you for tackling this!

@fabpot
Copy link
Member

fabpot commented Nov 29, 2025

Thank you @TamasSzigeti.

@fabpot fabpot merged commit d6a06c9 into symfony:7.3 Nov 29, 2025
11 checks passed
This was referenced Dec 7, 2025
@fabpot fabpot mentioned this pull request Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants