From 866bf5d520d20b28ba4ba923a9c180f53306dcf0 Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 15 May 2017 13:18:51 -0700 Subject: [PATCH] [server/validate] respond with all validation errors (#11776) * [server/validate] respond with all validation errors * [server/config] fail with all validation errors --- src/server/config/config.js | 5 ++++- src/server/http/setup_connection.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/server/config/config.js b/src/server/config/config.js index 1d036ca63e96a0..a7c017b7ea97c9 100644 --- a/src/server/config/config.js +++ b/src/server/config/config.js @@ -97,7 +97,10 @@ module.exports = class Config { ); } - const results = Joi.validate(newVals, this.getSchema(), { context }); + const results = Joi.validate(newVals, this.getSchema(), { + context, + abortEarly: false + }); if (results.error) { throw results.error; diff --git a/src/server/http/setup_connection.js b/src/server/http/setup_connection.js index 13e0d937ca1940..0d2b0e0e9aa58d 100644 --- a/src/server/http/setup_connection.js +++ b/src/server/http/setup_connection.js @@ -21,6 +21,11 @@ export default function (kbnServer, server, config) { cors: config.get('server.cors'), payload: { maxBytes: config.get('server.maxPayloadBytes') + }, + validate: { + options: { + abortEarly: false + } } } };