@middy/validator 3.0.0-alpha.5 → 3.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +6 -6
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -44,9 +44,9 @@ const validatorMiddleware = (opts = {}) => {
|
|
|
44
44
|
localize[language](inputSchema.errors);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const error = createError(400, 'Event object failed validation');
|
|
48
|
+
error.cause = inputSchema.errors;
|
|
49
|
+
throw error;
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -54,9 +54,9 @@ const validatorMiddleware = (opts = {}) => {
|
|
|
54
54
|
const valid = outputSchema(request.response);
|
|
55
55
|
|
|
56
56
|
if (!valid) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
const error = createError(500, 'Response object failed validation');
|
|
58
|
+
error.cause = outputSchema.errors;
|
|
59
|
+
throw error;
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/validator",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.6",
|
|
4
4
|
"description": "Validator middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/middyjs/middy#readme",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@middy/util": "^3.0.0-alpha.
|
|
51
|
-
"ajv": "8.
|
|
50
|
+
"@middy/util": "^3.0.0-alpha.6",
|
|
51
|
+
"ajv": "8.9.0",
|
|
52
52
|
"ajv-formats": "2.1.1",
|
|
53
53
|
"ajv-formats-draft2019": "1.6.1",
|
|
54
54
|
"ajv-i18n": "4.2.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@middy/core": "^3.0.0-alpha.
|
|
57
|
+
"@middy/core": "^3.0.0-alpha.6",
|
|
58
58
|
"@types/http-errors": "^1.8.1",
|
|
59
59
|
"ajv-bsontype": "^1.0.7"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "176660ed3e0716d6bfb635c77251b301e0e24720"
|
|
62
62
|
}
|