OpenApi to Plant UML conversion tool generates UML Class Diagrams from an Open API definition.
This is a fork of the original project Swagger2puml (https://github.com/kicksolutions/swagger2puml) which seems to have been dormant for some time.
This project is based on Maven. Following are modules we currently have
- openapi2puml-core
Following are the tools which this project internally uses:
- [Swagger Parser]
- [Plant UML]
- [Graphviz]
- [Mustache]
- Input: Openapi2Puml parses the swagger definition from input using [Swagger Parser]
- Transform: The swagger definition is built into an object model
- Output: The object model is transformed into a [Plant UML] file using a [Mustache] template. Optionally a .svg image can be generated also.
This utility takes OpenAPI Yaml or JSON as input generates swagger.puml and swagger.svg files as output.
Below is the Sample Class Diagram generated by the application. To see the generated PUML file, please click here
mvn package
The jar is built with dependencies and placed in the root of the project.
java -jar openapi2puml.jar [options]
-i {Path of Swagger Definition (Can be either Yaml or json)}
-o {Target location where Puml File and Image should generated}
-generateDefinitionModelOnly {true/flase Defult False (Optional)}
-includeCardinality {true/flase Defult true (Optional)}
-generateSvg true/false; Default=true
It is also to use a docker container to run the tool. Simply mount a directory
and add command line options by using docker run
, e.g.
# Run a docker container
$ sudo docker run -d -p 7000:7000 --name openapi2puml klauswr/openapi2puml:latest