These are chat archives for tmarrs/json-at-work

18th
Jul 2017
Tom Marrs
@tmarrs
Jul 18 2017 01:58

You need to filter the JSON data to reduce it just those 2 fields. Use jq to do this. Take a look at the jq Manual.

After you get comfortable with jq, use the following query:

Tom Marrs
@tmarrs
Jul 18 2017 02:09
[.[] | { app_site, app_tar}]
Then, update your code:
  1. Convert the jsonData byte array to a String so you can modify the data.
  2. Use the jackson-jq library to use jq from Java, and apply the above jq query. You'll use the String version of jsonData as input. Follow (jackson-jq Basic Example)[https://github.com/eiiches/jackson-jq#basic-example].
  3. Take the result (should be of type List<JsonNode>) and add it to Object Mapper. You'll need to figure this out yourself.
Please let me know if this helps.