From b9ce7cf47437b92321f12de20fd1e87fdbdac2a5 Mon Sep 17 00:00:00 2001 From: Jonathan Stoikovitch Date: Tue, 7 Mar 2017 21:10:33 -0800 Subject: [PATCH] default RAMLVersion to RAML08 to prevent a backward compatibility issue with Osprey 0.3.2. version++ --- README.md | 2 +- package.json | 2 +- raml-validate.js | 4 ++-- test.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index b8dca79..88e0ec4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ You must require the module and call it as a function to get a validation instan ```javascript var validate = require('raml-validate')(); -// RAML version to use, either 'RAML10' (default) or 'RAML08' +// RAML version to use, either 'RAML10' or 'RAML08' (default) var RAMLVersion = 'RAML10' // Create a user model schema. diff --git a/package.json b/package.json index 64cff65..352195e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "raml-validate", - "version": "1.1.0", + "version": "1.1.1", "description": "Strict validation of RAML parameters", "main": "raml-validate.js", "scripts": { diff --git a/raml-validate.js b/raml-validate.js index d267dc2..36c3b5a 100644 --- a/raml-validate.js +++ b/raml-validate.js @@ -357,8 +357,8 @@ module.exports = function () { } } - // RAML version. Default to RAML 1.0. - RAMLVersion = RAMLVersion || 'RAML10' + // RAML version. Defaults to RAML 0.8. + RAMLVersion = RAMLVersion || 'RAML08' var validations = {} var validateRule = RAMLVersion === 'RAML10' ? validate.ruleRAML10 : validate.rule diff --git a/test.js b/test.js index f52361f..212f94d 100644 --- a/test.js +++ b/test.js @@ -1409,7 +1409,7 @@ describe('raml-validate', function () { ].join(' ') it(description, function () { - var validity = validate(params)(object) + var validity = validate(params, 'RAML10')(object) expect(validity.valid).to.equal(valid) // skipping error check until https://github.com/raml-org/typesystem-ts/issues/80