Skip to content

[JsonPath] The JsonPath component should run the official conformance testsuite #60669

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

Open
stof opened this issue Jun 3, 2025 · 4 comments · May be fixed by #60695
Open

[JsonPath] The JsonPath component should run the official conformance testsuite #60669

stof opened this issue Jun 3, 2025 · 4 comments · May be fixed by #60695
Labels

Comments

@stof
Copy link
Member

stof commented Jun 3, 2025

Description

I just found out that there is a compliance testsuite for the JsonPath standard, available at https://github.com/jsonpath-standard/jsonpath-compliance-test-suite (see https://github.com/jsonpath-standard/jsonpath-compliance-test-suite/blob/main/cts.json for the full testsuite, generated from the individual files in the repo).

I suggest that our JsonPath component should have a test case running the compliance testsuite, with a data provider reading this cts.json file. The name of tests in the compliance test suite is guaranteed to be unique, so they can be used as keys in the data provider to make failure reporting better.

Example

No response

@stof
Copy link
Member Author

stof commented Jun 3, 2025

/cc @alexandre-daubois

@mttsch
Copy link
Contributor

mttsch commented Jun 3, 2025

Is the expectation for the JsonPath component to completely comply with this test suite? I tested around a bit and if I am not mistaken, there are several issues. Example for https://github.com/jsonpath-standard/jsonpath-compliance-test-suite/blob/main/cts.json#L1088-L1110:

$crawler = new JsonCrawler('[{"a": "1", "d": "e"}, {"a": 1, "d": "f"}]');
$crawler->find(new JsonPath("$[?@.a=='1']"));
Symfony\Component\JsonPath\Exception\JsonCrawlerException: Error while crawling JSON with JSON path "?@.a=='1'": Invalid filter expression.

@alexandre-daubois
Copy link
Member

@mttsch Yes! Most of the stabilization work for the next months will be about sticking to the RFC

@stof
Copy link
Member Author

stof commented Jun 4, 2025

@mttsch the component is meant to implement RFC9535, so definitely yes.

It is a bit unfortunate that I discovered the compliance testsuite only yesterday. It would have been useful to run it from the start.

mttsch added a commit to mttsch/symfony that referenced this issue Jun 4, 2025
mttsch added a commit to mttsch/symfony that referenced this issue Jun 4, 2025
mttsch added a commit to mttsch/symfony that referenced this issue Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy