How to Hihlight array item in Json data

0 votes
asked Dec 1, 2020 in Question / help by Serge Wenger Work (15,620 points)

Hello,

How to highlight Number 212 555-1234 in your sample https://plantuml.com/en/json?

1 Answer

0 votes
answered Dec 1, 2020 by plantuml (295,000 points)
selected Dec 2, 2020 by Serge Wenger Work
 
Best answer

You can use array index :

@startjson
#highlight "phoneNumbers" / "1" / "number"
{
  "firstName": "John",
  "lastName": "Smith",
  "isAlive": "true",
  "age": "27",
  "address": {
    "streetAddress": "21 2nd Street",
    "city": "New York",
    "state": "NY",
    "postalCode": "10021-3100"
  },
  "phoneNumbers": [
    {
      "type": "home",
      "number": "212 555-1234"
    },
    {
      "type": "office",
      "number": "646 555-4567"
    }
  ]
}
@endjson

We should probably enhance all this : this is really a first release :-)

commented Dec 2, 2020 by Serge Wenger Work (15,620 points)
Thanks for your answer. It is really very good for a first release :-))

I try to add this example in the Wiki.
...