Giter Site home page Giter Site logo

Comments (9)

bradleymorris avatar bradleymorris commented on May 12, 2024

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.

kallestenflo avatar kallestenflo commented on May 12, 2024

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.

bradleymorris avatar bradleymorris commented on May 12, 2024

I am using 2.0.0.

from jsonpath.

kallestenflo avatar kallestenflo commented on May 12, 2024

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.

bradleymorris avatar bradleymorris commented on May 12, 2024

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.

jochenberger avatar jochenberger commented on May 12, 2024

The test works for me too both from Eclipse and shell. @bradleymorris, how do you run the test?

from jsonpath.

bradleymorris avatar bradleymorris commented on May 12, 2024

I am running the test with a JUnit-natured run configuration in Eclipse.

from jsonpath.

jochenberger avatar jochenberger commented on May 12, 2024

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 the issue_143 method.

from jsonpath.

kallestenflo avatar kallestenflo commented on May 12, 2024

Can not reproduce

from jsonpath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.