grunt-blueprint-validator
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -9,2 +9,10 @@ var jsonUtils = require('./utils/json-utils'); | ||
function hasJsonBody(){ | ||
return !!spec.body; | ||
} | ||
function hasJsonSchema(){ | ||
return !!spec.schema; | ||
} | ||
var errorHandler = function(prefix){ | ||
@@ -25,7 +33,15 @@ return function(err){ | ||
if (isJsonSpec) { | ||
jsonUtils.parseBody(spec, errorHandler('JSON Body validation')); | ||
jsonUtils.validateAndParseSchema(spec, errorHandler('JSON Schema validation')); | ||
jsonUtils.validateJsonAgainstSchema(spec.body, spec.schema, errorHandler()); | ||
if (hasJsonBody()) { | ||
jsonUtils.parseBody(spec, errorHandler('JSON Body validation')); | ||
} | ||
if (hasJsonSchema()){ | ||
jsonUtils.validateAndParseSchema(spec, errorHandler('JSON Schema validation')); | ||
} | ||
if (hasJsonBody() && hasJsonSchema()) { | ||
jsonUtils.validateJsonAgainstSchema(spec.body, spec.schema, errorHandler()); | ||
} | ||
} | ||
}; | ||
}; |
{ | ||
"name": "grunt-blueprint-validator", | ||
"description": "Validates Blueprint files.", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"homepage": "https://github.com/Aconex/grunt-blueprint-validator", | ||
@@ -6,0 +6,0 @@ "author": { |
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
18165
15
415