1.0.0 • Published 4 years ago
swagger-to-plantuml v1.0.0
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.
Example Diagrams
Swagger 2.0
OpenAPI 3.0
1.0.0
4 years ago