Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

gson.JsonObject is not Json object according to the JsonProvider #1021

Open
fadi-shahoud opened this issue Sep 17, 2024 · 0 comments
Open

gson.JsonObject is not Json object according to the JsonProvider #1021

fadi-shahoud opened this issue Sep 17, 2024 · 0 comments

Comments

@fadi-shahoud
Copy link

JsonPath jsonPath = JsonPath.compile("$.data[*]"); Object parse = Configuration.builder().jsonProvider(new GsonJsonProvider()).build().jsonProvider().parse(testJson); JsonArray arrValues = jsonPath.read(parse); List<String> values = new Gson().fromJson(arrValues, new TypeToken<List<String>>() {}.getType());
Exception message:
Exception in thread "main" com.jayway.jsonpath.PathNotFoundException: Expected to find an object with property ['data'] in path $ but found 'com.google.gson.JsonObject'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant