JSON Diagrams: Request to differentiate explicitly boolean and string on the output

0 votes
asked Dec 9, 2020 in Wanted features by The-Lu (12,360 points)

Hello PlantUML team,

Here is a wanted feature:

  • Is it possible to have got a parameter or another thing (manually activate or not; possible to deactivate for people which don't want this functionality), to differentiate explicitly boolean and string on the output, example:
@startjson
{
"JSON_Boolean_value": true,
"JSON_Boolean_value": false,
"JSON_String_value": "true",
"JSON_String_value": "false"
}
@endjson

I am open to all propositions, as: style (italic, ...), font (monospaced [but not so good, if on the future we would to change all the value to be on a monospaced font]), 'b' indices for boolean (as trueb or falseb), ...
→ I don't know what are the best solution.

Thanks for your support,
Regards,
Th.

1 Answer

0 votes
answered Dec 9, 2020 by plantuml (240,420 points)
selected Dec 14, 2020 by The-Lu
 
Best answer

I don't know what are the best solution.

I don't know either. Maybe https://www.google.com/search?q=true+false+symbol or https://www.google.com/search?q=true+false+symbol&tbm=isch could be a source of inspiration ?

commented Dec 9, 2020 by The-Lu (12,360 points)

Hello PlantUML team,

Another 'source of inspiration' is the online JSON editors:

With that, the boolean value are interpreted as box, as Checkbox, empty for false value, and with a tick for true value.

Then here are some output proposals (first Proposal from your google request inspiration, second Proposal from the Checkbox inspiration):

@startjson
#highlight "Proposal"
{
"JSON_Boolean_value_t": true,
"JSON_Boolean_value_f": false,
"JSON_String_value_t": "true",
"JSON_String_value_f": "false",
"Proposal":null,
"Proposal_value_t0": "<&circle-check> true",
"Proposal_value_f0": "<&circle-x> false ",
"Proposal":null,
"Proposal_value_t1": "<&task> true",
"Proposal_value_t2": "<U+2611> true",
"Proposal_value_f2": "<U+2610> false",
"Proposal_value_t3": "<U+1F5F9> true"
}
@endjson

Another proposal for other people are welcome...

If that can help,
Regards,
Th.

commented Dec 9, 2020 by plantuml (240,420 points)
I like Proposal_value_t2 and Proposal_value_f2.

Since we are here, what about the special 'null' value ? Should we use a symbol for it too ?
commented Dec 9, 2020 by plantuml (240,420 points)
We've just published a beta.

Tell us what you think about it!
commented Dec 9, 2020 by The-Lu (12,360 points)

And for null:

  • Why not use the Unicode representative character <U+2400> for null:
@startjson
#highlight "Proposal"
{
"JSON_Null_value":       null,
"JSON_String_value":     "null",
"Proposal":              null,
"Proposal_value_null_1": "<U+2400>",
"Proposal_value_null_2": "<U+2400> null"
}
@endjson

Regards,
Th.

commented Dec 11, 2020 by The-Lu (12,360 points)

Hello PlantUML,

Do you keep the empty set symbol ('ø', '∅'  <U+2205>) or do you want to change to Unicode representative character <U+2400> for nul?

Regards,
Th.

commented Dec 11, 2020 by plantuml (240,420 points)

Well, it's really easy to change. On second though, I think we are going to use <U+2400>

It may be more logical. That's what last beta http://beta.plantuml.net/plantuml.jar is doing.

Does it sound good to you ?

commented Dec 14, 2020 by The-Lu (12,360 points)

Hello PlantUML team,

That is perfect for me.
(apart from a bug on the Samsung side which misunderstands Unicode... and transforms the ballot box (geometric box [square]) on a real physical ballot box! devil [sacred Unicode interpretation]). [We still find bugs now, but in other applications. laugh]

Another item ("Since we are here" wink), will be to differentiate number and string.

@startjson
{
"JSON_Number_value": 42,
"JSON_String_value": "42"
}
@endjson

But I have no proposal or no idea...

Regards,
Th.

...