json-to-plantuml
Transforms JSON to Plant UML to help visualize your JSON data.
Example JSON data
"name": "Product" "properties": "id": "type": "number" "description": "Product identifier" "required": true "name": "description": "Name of the product" "type": "string" "required": true "price": "type": "number" "minimum": 0 "required": true "tags": "type": "array" "items": "type": "string"
Example Plant UML outut
As CMD line tool
Install
$ npm install -g json-to-plantuml
Run
$ echo '{"foo": "bar"}' | json-to-plantuml$ json-to-plantuml -f .\data\albumdata.json
Piping to PlantUML to generate image
$ echo '{"foo": "bar"}' | json-to-plantuml | java -jar plantuml.jar -pipe > foobar.png$ json-to-plantuml -f .\data\albumdata.json | java -jar plantuml.jar -pipe > albumdata.png
Install Dependencies to generate image
Java, Plant UML, GraphViz
Known to work with PlantUML following versions
plantuml-jar-lgpl-8048
plantuml-jar-lgpl-8049
As project dependency
Install
$ npm install --save json-to-plantuml
Code
var jsonToPlantUml = ; ;
Output
@startuml
class "root" as root {
.. Properties ..
foo: bar
}
@enduml