Generates Mermaid diagrams from OpenApi Docs
NPM package use to generate mermaid diagram documentation for endpoints documented by swagger using the OpenAPI spec.
import { generateDiagrams } from 'openapi-mermaid';
generateDiagrams({
openApiJsonUrl: '{Your Swagger Enpoint URL here}',
outputPath: './{outputFolder}/',
outputFileName: 'class-diagram', /* This is an optional parameter */
});
import { generateDiagrams } from 'openapi-mermaid';
generateDiagrams({
openApiJsonFileName: '{location and file name of your OpenApi document}',
outputPath: './{outputFolder}/',
outputFileName: 'class-diagram', /* This is an optional parameter */
});
const generator = require('openapi-mermaid');
generator.generateDiagrams({
openApiJsonUrl: '{Your Swagger Enpoint URL here}',
outputPath: './{outputFolder}/',
});
const generator = require('openapi-mermaid');
generator.generateDiagrams({
openApiJsonFileName: '{location and file name of your OpenApi document}',
outputPath: './{outputFolder}/',
});
import { generateDiagrams } from 'openapi-mermaid';
generateDiagrams({
openApiJsonUrl: 'https://im-wa-cmpo-nrsr.azurewebsites.net/swagger/v1/swagger.json',
outputPath: './models/',
typeFilterCallBack: (val, i, arr) => !val.name.endsWith('ODataEnvelope'),
valuePropertyTypeFilterCallBack: (val, i, arr) => !val.name.startsWith('created') && !val.name.startsWith('updated'),
});