diff --git a/lib/formats/json/parser.js b/lib/formats/json/parser.js index 115b6ae..66e5419 100644 --- a/lib/formats/json/parser.js +++ b/lib/formats/json/parser.js @@ -1,9 +1,5 @@ -var Spec02 = require("../../specs/spec_0_2.js"); +function JSONParser() { -const spec02 = new Spec02(); - -function JSONParser(_spec) { - this.spec = (_spec) ? _spec : new Spec02(); } /** @@ -45,13 +41,10 @@ function validate_spec(payload, spec) { JSONParser.prototype.parse = function(payload) { - // Level 0 of validation: is that string? is that JSON? - var valid0 = validate_and_parse_as_json(payload); + //is that string? is that JSON? + var valid = validate_and_parse_as_json(payload); - // Level 1 of validation: is that follow a spec? - var valid1 = validate_spec(valid0, this.spec); - - return valid1; + return valid; } module.exports = JSONParser;