Skip to content

Commit

Permalink
[server/validate] respond with all validation errors (elastic#11776)
Browse files Browse the repository at this point in the history
* [server/validate] respond with all validation errors

* [server/config] fail with all validation errors
  • Loading branch information
spalger committed May 15, 2017
1 parent d23fa36 commit 866bf5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/server/http/setup_connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
};
Expand Down

0 comments on commit 866bf5d

Please sign in to comment.