Good morning!
I implemented a loadJSON function yesterday and wanted to make a pull request shortly. The implementation uses SFile and SURL so that JSON data can be loaded locally and from REST interfaces. I followed the proposal on the http://wiki.plantuml.net/site/preprocessing-json site. However, there are two more optional parameters. A default JSON if the data source does not provide any data and the possibility to define a charset encoding.
Here is an example:
@startuml
' This example works only with the latest plantuml snapshot an implemented
' %loadJSON function
' Default JSON, if we don't get a content from the data source
!$DEF={"status": "not connected"}
' Load from Spring boot service with actuator 'health' endpoint
!$TEST=%loadJSON("http://localhost:7778/management/health", $DEF)
' Load from local file (relative located in plantuml.include.path list)
!$DEMO=%loadJSON("demo.json")
title Load JSON example with $DEMO.status
' Simple usage
[Service] -> ($TEST.status): is
' Embedded rendering of JSON structure
rectangle Inner #tan as "
{{json
$TEST
}}
Health of management service at %date()
"
@enduml