Comments (9)
Forgot to mention, stepping through with the debugger, it is clear that REQUIRE_PROPERTIES is not being set by default. When I submit the ReadContext.read() request, there is only a single config option in the list - AS_PATH_LIST.
from jsonpath.
I tried this in version 2.0.0 and 2.1.0 and it works as expected
@Test
public void issue_143() {
String json = "{ \"foo\": { \"bar\" : \"val\" }, \"moo\": { \"cow\" : \"val\" } }";
Configuration configuration = Configuration
.builder()
.options( Option.AS_PATH_LIST )
.build();
List<String> pathList = JsonPath
.using(configuration)
.parse(json)
.read("$.*.bar");
assertThat(pathList).containsExactly("$['foo']['bar']");
}
What version are you using?
from jsonpath.
I am using 2.0.0.
from jsonpath.
And the test I provided fails?
Sent from my iPhone
On 26 nov. 2015, at 19:28, bradleymorris [email protected] wrote:
I am using 2.0.0.
—
Reply to this email directly or view it on GitHub.
from jsonpath.
Yes, this test fails. I had to refactor the assertThat() line to:
Assert.assertThat(pathList, hasItem("$['foo']['bar']"));
...but it does not matter. I get precisely the same Exception and stack trace that I provided in the initial bug description when read() is called.
For the record, 'configuration.jsonProvider().getClass().getName()' tells me I am using the com.jayway.jsonpath.spi.json.JsonSmartJsonProvider.
from jsonpath.
The test works for me too both from Eclipse and shell. @bradleymorris, how do you run the test?
from jsonpath.
I am running the test with a JUnit-natured run configuration in Eclipse.
from jsonpath.
I cannot reproduce this. Here's what I do (with current git master):
- open json-path project in eclipse
- open
com.jayway.jsonpath.old.IssuesTest
- right-click on the class name and choose Run As -> JUnit Test
The test completes successfully, including theissue_143
method.
from jsonpath.
Can not reproduce
from jsonpath.
Related Issues (20)
- Remove Analytics image from README
- Trailing newline character in path is not handled
- How to get the first element after filtering?
- Default CacheProvider hides failing tests
- concurrency issue / race condition HOT 2
- Issue with Version 2.8 - JsonPath.java#set() and JsonPath.java#add() HOT 2
- get null when element not exists
- json-path-2.2.0.jar library vulnerability HOT 2
- will we see a YAML Path library? HOT 1
- The number read is counted by Scientific notation
- .set() method should add the key value if its not present HOT 1
- Support XPATH function substring-before,substring-after,translate
- Union of missing properties returns empty object
- Add support for custom Functions registration
- changelog.md is not updated HOT 1
- Provides transitive vulnerable dependency maven:com.jayway.jsonpath:json-path:2.8.0 CVE-2023-51074 5.3 Out-of-bounds Write vulnerability with Medium severity found Results powered by Checkmarx(c) HOT 2
- [2.8.0, 2.9.0] Aggregation function attempted to calculate value using empty array
- How to reference name of element itself when doing a filter
- Configuration method name does not match function
- Consider implementing RFC 9535 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonpath.