api-doc-validator
Advanced tools
Comparing version 2.27.0 to 2.28.0
35
cli.js
@@ -122,7 +122,3 @@ #!/usr/bin/env node | ||
const defaultSchemas = {}; | ||
for (const path of defaultSchemasPaths) { | ||
Object.assign(defaultSchemas, require(path)); | ||
} | ||
@@ -143,10 +139,29 @@ let files = getFiles(config.include); | ||
if (typeof config.extraProps === 'boolean') { | ||
getProp(defaultSchemas.object, 'additionalProperties').value.value = config.extraProps; | ||
} | ||
Promise.all( | ||
defaultSchemasPaths.map(path => { | ||
let schema = require(path); | ||
const cache = {...defaultSchemas}; | ||
if (typeof schema === 'function') { | ||
schema = schema(); | ||
} | ||
filesToEndpoints(files, {...config, schemas: cache}) | ||
.then(function (endpoints) { | ||
return schema; | ||
}) | ||
) | ||
.then(async function (schemasList) { | ||
const defaultSchemas = {}; | ||
for (const schema of schemasList) { | ||
Object.assign(defaultSchemas, schema); | ||
} | ||
if (typeof config.extraProps === 'boolean') { | ||
getProp(defaultSchemas.object, 'additionalProperties').value.value = config.extraProps; | ||
} | ||
const cache = {...defaultSchemas}; | ||
let endpoints = await filesToEndpoints(files, {...config, schemas: cache}); | ||
if (config.namespace) { | ||
@@ -153,0 +168,0 @@ let namespaces = config.namespace.reduce(function (hash, name) { |
{ | ||
"name": "api-doc-validator", | ||
"version": "2.27.0", | ||
"version": "2.28.0", | ||
"description": "api doc and validator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
70596
2053