openapi-to-md
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -49,2 +49,6 @@ #!/usr/bin/env node | ||
}; | ||
const convertPath = (path) => path | ||
.replace(/[!@#$%^&*()+|~=`[\]{};':",./<>?]/g, "") | ||
.replace(/ /g, "-") | ||
.toLowerCase(); | ||
const outputPathTable = ({ document, pathMethods }) => { | ||
@@ -59,3 +63,3 @@ let output = `# ${document.info.title || "Api-Document"}\n\n> Version ${document.info.version || "1.0.0"} | ||
output += pathMethods.reduce((a, { path, method, operation }) => a + | ||
`| ${method.toUpperCase()} | [${path}](#[${method}]${path}) | ${operation.summary || ""} |\n`, ""); | ||
`| ${method.toUpperCase()} | [${path}](#${method.toLowerCase()}${convertPath(path)}) | ${operation.summary || ""} |\n`, ""); | ||
return output + "\n"; | ||
@@ -72,3 +76,3 @@ }; | ||
const v = getApiObject(apiDocument, value); | ||
output += `| ${v.name || v.title || key ? key.substr(key.lastIndexOf("/") + 1) : ""} | ${key ? `[${key}](${key})` : ""} | ${v.description || ""} |\n`; | ||
output += `| ${v.name || v.title || key ? key.substr(key.lastIndexOf("/") + 1) : ""} | ${key ? `[${key}](#${convertPath(key)})` : ""} | ${v.description || ""} |\n`; | ||
}); | ||
@@ -75,0 +79,0 @@ return output + "\n"; |
{ | ||
"name": "openapi-to-md", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14817
360