From 2896549cdb6b7a7c29ee4bdbb45d5bdf5d59e9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro?= Date: Fri, 2 Feb 2018 10:39:04 +0100 Subject: [PATCH] Check all required properties are defined --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index de21eae..d073a85 100644 --- a/index.js +++ b/index.js @@ -98,6 +98,9 @@ var types = { var required = {}; if (s.required) { s.required.forEach(function(k) { + if (!s.properties.hasOwnProperty(k)) { + t.fail('[tcomb-json-schema] Missing required property ' + k); + } required[k] = true; }); }