Sunday, 4 August 2019

angular - highlight json field based on jsonpath

I have two jsons of different structure and fields. But on functional view they have similar fields except that the field names are different. So I have the following:

  • json1 payload
  • json2 payload
  • list of jsonpaths (of json1 and json2) that says which is equivalent to which from json1 and json2, and name identifier to this pair of jsonpath

I'm thinking of displaying something like this on angular page:

  • 1st column - jsonpath pair identifier
  • 2nd column - json1 payload
  • 3rd column - json2 payload

Wanted to have the JSON fields color-coded or highlighted if it matches the list of jsonpaths. Is this possible? Any leads?

Example:

JsonPath pair: [name, body.identifier]

1st json: {"id": "myId", "name":"reika"}

2nd json: {"unique": "myId", "body": { "identifier" : "reikaName"} }

Wanted to have the above fields highlighted on my angular page when the json was displayed (as they match the first json pair).



from angular - highlight json field based on jsonpath

No comments:

Post a Comment