Hello PlantUML team,
From:
- Why can't I compare JSON variable with boolean?
or How to store PlantUML boolean on JSON variable?
I got very confused with the test of boolean value from JSON variable.
Here is an example:
@startuml
!$json = {
"value": ["0", 0 , false, null, true, "1", 1, ""]
}
:$json.value;
split
:test of 'v';
!foreach $v in $json.value
!if ( $v )
#palegreen:is true;
!else
#pink:is false;
!endif
!endfor
kill
split again
:test of 'v == <U+0025>true()';
!foreach $v in $json.value
!if ( $v == %true() )
#palegreen:is true;
!else
#pink:is false;
!endif
!endfor
kill
endsplit
@enduml
If that is clear,
Regards,
Th.