swagger-to-plantuml
v1.0.0
Published
Converts swagger specs to plantuml charts
Downloads
7
Readme
Swagger to PlantUML
This package allows to create a UML diagram that represents the structure of the API.
It supports both Swagger 2.0 schema and OpenAPI 3.0 Schema
Usage
const { swaggerToPlantUML } = require('swagger-to-plantuml')
// ...
const pumlCode = await swaggerToPlantUML(swaggerOrOASSpecPath)
Then you can use some library like node-plantuml to create the actual diagram.
const fs = require('fs')
const puml = require('node-plantuml')
// ...
const gen = puml.generate(pumlCode, { format: 'png' })
gen.out.pipe(fs.createWriteStream(outputPath))
swaggerToPlantUML(api)
It creates the PlantUML definition for
api(required)
string
The file path or URL of your Swagger API.
Return value
Promise<string>
PlantUML diagram definition text.