Introduction of an internal function %loadJSON to load JSON data#755
Introduction of an internal function %loadJSON to load JSON data#755arnaudroques merged 1 commit intoplantuml:masterfrom
Conversation
|
Thanks for your code: this looks good ! |
Sorry for the formatting issues. The new setup of my IntelliJ project was not well aligned (some artifacts from my company formatting stuff).
Of course. I'm an architect and want to create architecture models on-the-fly. In my opinion this is a certain step in CI/CD. No one likes to draw manually diagrams on any new architecture or deployment change. Now I can fetch OpenAPI outputs, monitor actuator endpoints, read Kubernetes and/or Rancher configs and create model snapshots from dev, test or customer environments. I've integrated PlantUml in gradle and as IntelliJ plugin to raise up a project to create an architecture documentation on-the-fly. The next step will be to add authentication. Let's see how this will work. |
|
Shouldn't it be called |
Sure, you're right. We will probably remove |
This new internal function %loadJSON allows loading a JSON data structure from a local file or external HTTP(s) URL.
The implementation uses SFile and SURL to manage the security context and configured opt-in folders/domains.
loadJSON supports up to three parameters. A mandatory data-source path (relative file, absolute file-path, http, and https URL), a second default parameter to define a fallback JSON (if the data source has no content), and a third default parameter to choose a charset encoding (default is UTF-8).
A test is included (but only for local files). Short introduction in the JavaDoc comment of LoadJson.java. Also, the test file gives an impression of how to use it.
Example to access a Spring cloud native service (health actuator endpoint):
Limitations:
Authentication is currently not supported. Maybe this should be applied to SURL but it's out of scope for this pull request.