@serverless-seoul/corgi
Advanced tools
Comparing version 4.0.0-beta.1 to 4.0.0-beta.2
@@ -0,1 +1,8 @@ | ||
# [4.0.0-beta.2](https://github.com/serverless-seoul/corgi/compare/v4.0.0-beta.1...v4.0.0-beta.2) (2020-09-25) | ||
### Bug Fixes | ||
* **parameter:** stripping out unknown parameter should work with oneOf (union) type ([7f6a5d9](https://github.com/serverless-seoul/corgi/commit/7f6a5d95df1950bb6573d49079fa4d7f3b1ca1f7)) | ||
# [4.0.0-beta.1](https://github.com/serverless-seoul/corgi/compare/v3.2.1-beta.1...v4.0.0-beta.1) (2020-09-25) | ||
@@ -2,0 +9,0 @@ |
@@ -5,12 +5,6 @@ "use strict"; | ||
const typebox_1 = require("@serverless-seoul/typebox"); | ||
const Ajv = require("ajv"); | ||
const _ = require("lodash"); | ||
const qs = require("qs"); | ||
const errors_1 = require("./errors"); | ||
const ajv = new Ajv({ | ||
allErrors: true, | ||
async: false, | ||
coerceTypes: true, | ||
removeAdditional: "all", | ||
}); | ||
const ajv_1 = require("./ajv"); | ||
// ---- RoutingContext | ||
@@ -67,6 +61,6 @@ class RoutingContext { | ||
const params = _.cloneDeep(rawParams !== null && rawParams !== void 0 ? rawParams : {}); | ||
const valid = ajv.validate(typebox_1.Type.Object(schemaMap), params); | ||
const valid = ajv_1.ajv.validate(typebox_1.Type.Object(schemaMap), params); | ||
if (!valid) { | ||
const errors = ajv.errors; | ||
throw new errors_1.ValidationError(ajv.errorsText(errors), errors); | ||
const errors = ajv_1.ajv.errors; | ||
throw new errors_1.ValidationError(ajv_1.ajv.errorsText(errors), errors); | ||
} | ||
@@ -73,0 +67,0 @@ Object.assign(this.validatedParams, params); |
{ | ||
"name": "@serverless-seoul/corgi", | ||
"version": "4.0.0-beta.1", | ||
"version": "4.0.0-beta.2", | ||
"description": "Restful HTTP Framework for AWS Lambda - AWS API Gateway Proxy Integration", | ||
@@ -5,0 +5,0 @@ "main": "./dst/index.js", |
Sorry, the diff of this file is not supported yet
94437
61
1398