https://github.com/kicksolutions/swagger2puml
Generate Class Diagrams (UML) for Given Swagger Definition
https://github.com/kicksolutions/swagger2puml
graphviz plantuml swagger-codegen swagger-parser swagger2 uml uml-class-diagram uml-diagram uml-diagrams uml-model
Last synced: 3 months ago
JSON representation
Generate Class Diagrams (UML) for Given Swagger Definition
- Host: GitHub
- URL: https://github.com/kicksolutions/swagger2puml
- Owner: kicksolutions
- License: apache-2.0
- Created: 2017-12-15T18:01:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-13T00:32:09.000Z (over 5 years ago)
- Last Synced: 2025-07-31T08:18:34.423Z (8 months ago)
- Topics: graphviz, plantuml, swagger-codegen, swagger-parser, swagger2, uml, uml-class-diagram, uml-diagram, uml-diagrams, uml-model
- Language: Java
- Homepage:
- Size: 99.6 KB
- Stars: 46
- Watchers: 4
- Forks: 18
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/kicksolutions/swagger2puml)
[](https://oss.sonatype.org/#nexus-search;gav~io.github.kicksolutions~swagger-plantuml-core~~~)
[](https://codecov.io/gh/kicksolutions/swagger2puml)
# Swagger2Puml
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:
- [Swagger Parser]
- [Plant UML]
- [Graphviz]
- [Mustache]
Please [install](https://graphviz.gitlab.io/download/) 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
## swagger2puml-core:
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](examples/swagger.puml)

### Usage:
```
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)}
```
## swagger2puml-maven
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.
License
----
Apacahe 2.0
[Plant UML]:
[Swagger]:
[Swagger Parser]:
[Graphviz]:
[Mustache]: