json content tooltip on sequence diagram

0 votes
asked Oct 30, 2015 in To be sorted by anonymous

Hi,

I'd like to show a json content tooltip (including braces "{" and "}")  on the sequence diagram. It looks like [[http://www.yahoo.com {{"firstName":"Bob", "lastName":"Smith"}} add a tooltip]] does not work.

Any thought?

Thanks,

Hong

1 Answer

0 votes
answered Nov 1, 2015 by plantuml (294,960 points)
This has been fixed in V8032.

You can now have:

@startuml
Alice -> Bob : [[http://www.yahoo.com{Jason: {"firstName":"Bob", "lastName":"Smith"}}]] hello
@enduml

Is this what you are looking for ?
commented Nov 3, 2015 by anonymous
It works with version 3082 now. Thanks a lot.
commented Nov 12, 2015 by anonymous
edited Nov 13, 2015
It looks like the following json tooltip is not working with the latest version 8032. The json content has multiple layers which means it has multiple "{}" in its contents.
@startuml
Alice -> Bob : [[http://www.yahoo.com{{"Jason": {"firstName":"Bob", "lastName":"Smith"},\n "Carl": {"firstName":"Alice", "lastName":"Brown"}}}]] Hello
@enduml


Thanks
commented Nov 13, 2015 by plantuml (294,960 points)
PlantUML uses regular expression to parse text diagrams, and it's difficult/impossible to completely support balanced parenthesis/bracket with regular expressions.
(except with some extensions that are not available in Java).
See:
http://stackoverflow.com/questions/133601/can-regular-expressions-be-used-to-match-nested-patterns
http://stackoverflow.com/questions/14952113/how-can-i-match-nested-brackets-using-regex

However, the good news is that is possible to support brackets with a *finite* limit of nested brackets.

With the last beta, we set the imbrication limit to 3, hoping that it will be ok:

https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

Tell us if it's enough for you.

Thanks
commented Nov 13, 2015 by anonymous
Thanks a lot for your quick reply!
...