Skip to content

return JSON text instead of null #42

@shalva97

Description

@shalva97

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions