[server/validate] respond with all validation errors (#11776)

* [server/validate] respond with all validation errors

* [server/config] fail with all validation errors
This commit is contained in:
Spencer 2017-05-15 13:18:51 -07:00 committed by GitHub
parent d23fa3689b
commit 866bf5d520
2 changed files with 9 additions and 1 deletions

View file

@ -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;

View file

@ -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
}
}
}
};