1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
Jan Steemann 2015-07-30 20:03:42 +02:00
commit 40c1ec0dec
2 changed files with 3 additions and 3 deletions

View File

@ -35,7 +35,7 @@ var SwaggerDocs = require("org/arangodb/foxx/swaggerDocs").Docs,
internal = require("org/arangodb/foxx/internals"),
toJSONSchema = require("org/arangodb/foxx/schema").toJSONSchema,
is = require("org/arangodb/is"),
BadRequest = require("http-errors").BadRequest,
UnprocessableEntity = require("http-errors").UnprocessableEntity,
UnauthorizedError = require("org/arangodb/foxx/authentication").UnauthorizedError;
function createBodyParamExtractor(rootElement, paramName, allowInvalid) {
@ -101,7 +101,7 @@ function validateOrThrow(raw, schema, allowInvalid) {
}
var result = joi.validate(raw, schema);
if (result.error && !allowInvalid) {
throw new BadRequest(result.error.message.replace(/^"value"/, 'Request body'));
throw new UnprocessableEntity(result.error.message.replace(/^"value"/, 'Request body'));
}
return result.value;
}

View File

@ -982,7 +982,7 @@ function DocumentationAndConstraintsSpec () {
callback(req, res);
assertFalse(called);
assertEqual(res.responseCode, 400);
assertEqual(res.responseCode, 422);
},
testSetParamForUndocumentedBodyParam: function () {