First: Thanks for your json developpment.
Could you add this functionality :
- Return 'false value' (for testing on '!if' function) [or 'undef'] when we point to a json field which does not exist (for a element on the json data) ?
For example : What's happen when a data is missing on a json Data Structures (example, with a 'color' field missing for the 'eve' employee)
Here is an example:
@startuml
!$foo = { "company": "Skynet", "employees" : [
{"name" : "alice", "salary": 100, "color" : "pink"},
{"name" : "bob", "salary": 50, "color" : ""},
{"name" : "carol", "salary": 50, "color": false},
{"name" : "dave", "salary": 50, "color" : null}
',{"name" : "eve", "salary": 50}
]}
start
!foreach $emp in $foo.employees
!if $emp.color
#$emp.color:The salary of $emp.name is $emp.salary (color: $emp.color);
!else
:The salary of $emp.name is $emp.salary (color: no color);
!endif
!endfor
@enduml
Link:
http://www.plantuml.com/plantuml/umla/bP11IyD048Nl-ojUre8AeTI3buY_Gc_YOPhEqgMJdR0RXL3otsMJeeb1eQVbiU_x7aonSQfunXcsrgQbqDiAzkNK1-vi2SjDAzep9uiARmOusq0DvsH9VCsvb4WePl1XjokpI3IEZTQ7antA9RRN_G9wN3AhVarHvI-YWYD9_9ivq2V_Cn8-H0O3t9OpXbV8ODu7Or97iJE5qyXK7x7XfeKFo8VRVf_708Ltu-Tsd340SFEJgzSZOt93ByKy3P-cSFcxczepq_rJbhCa7ftNYe9YhWa7xqn-dCOl
In order to test, please to uncomment the line, : ',{"name" : "eve", "salary": 50}
Thanks for your actions,
Regards,
Th.