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

return JSON text instead of null #42

Open
shalva97 opened this issue Jul 20, 2023 · 0 comments
Open

return JSON text instead of null #42

shalva97 opened this issue Jul 20, 2023 · 0 comments

Comments

@shalva97
Copy link

For example, I have such JSON

{
  "profile": {
    "name": "George",
    "address": {
      "home": "@ubuntu"
    }
  }
}

when I call JsonPath.parse(jsonText)?.read<String>("$.profile.address") it returns null. Instead return the object:

[
  {
    "home": "@ubuntu"
  }
]

My usecase is that there is a website im scraping, which returns huge JSON, but I dont want models for all the objects. If I could get those small snippets of JSON then I would be able to serialize them into smaller more useful models.

# 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