Generate Class Diagrams (UML) for Given Swagger Definition
Clone or download
Santosh Manapragada
Santosh Manapragada Fixing gitignore
Latest commit 36aae9a Jan 8, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
cfg/maven Remove *.sh files theyare not required, travil can handle better Dec 20, 2017
examples Adding Examples to Git Dec 15, 2017
.gitignore Fixing gitignore Jan 8, 2018
.travis.yml remove -U Dec 17, 2017
LICENSE Initial commit Dec 15, 2017 Updating Dec 20, 2017
pom.xml Added Plant UML JAR to generate SVG output Dec 17, 2017

Build Status Maven Central codecov


Swagger to Puml convertion tool helps to generate Class Diagrams from Swagger Definition.

This Project is based on Maven and plan to support Gradle also in future. Following are modules we currently have

  • swagger2puml-core
  • swagger2puml-maven

Following are the tools which this project internally uses:

Please install Graphviz on your machines, ensure you edit PATH varible of your machine and add bin folder of graphviz.

Create a new System Variable called GRAPHVIZ_DOT and point to dot.exe for windows and dot in case of Linux in bin folder of graphviz.

How does it work

  • Swagger2Puml internally reads the swagger definition using Swagger Parser which then converts the Swagger Definition to swagger.puml
  • Once the swagger.puml gets generated sucessfully it then calls Plant UML to generate swagger.svg


This utility takes Swagger Yaml as input and as response it generates swagger.puml and swagger.svg files as output.

Below is the Sample Class Diagram which gets generated. To see the generated PUML file, please click here



java -cp swagger2puml.jar com.kicksolutions.swagger.Swagger2PlantUML [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)}
-includeCardinality {true/flase Defult true (Optional)}


This Maven plugin is Mojo, which internally calls swagger2puml-core to generate swagger.puml and swagger.svg for given Swagger Definition. Swagger Definition can be either yaml or json extensions.


Apacahe 2.0