@open-rpc/schema-utils-js
Advanced tools
Comparing version 1.12.2 to 1.12.3
@@ -86,13 +86,18 @@ "use strict"; | ||
.map(function (param, index) { | ||
var id = index; | ||
if (method.paramStructure === "by-name") { | ||
id = param.name; | ||
} | ||
if (param.schema === undefined) { | ||
return; | ||
} | ||
if (!params[index] && !param.required) { | ||
var input = params[id]; | ||
if (input === undefined && !param.required) { | ||
return; | ||
} | ||
var idForMethod = generate_method_id_1.generateMethodParamId(method, param); | ||
var isValid = _this.ajvValidator.validate(idForMethod, params[index]); | ||
var isValid = _this.ajvValidator.validate(idForMethod, input); | ||
var errors = _this.ajvValidator.errors; | ||
if (!isValid) { | ||
return new parameter_validation_error_1.default(index, param.schema, params[index], errors); | ||
return new parameter_validation_error_1.default(id, param.schema, input, errors); | ||
} | ||
@@ -99,0 +104,0 @@ }) |
@@ -0,1 +1,10 @@ | ||
## [1.12.3](https://github.com/open-rpc/schema-utils-js/compare/1.12.2...1.12.3) (2020-03-27) | ||
### Bug Fixes | ||
* add proper test cov and fix by-name ([31caaf0](https://github.com/open-rpc/schema-utils-js/commit/31caaf08f862e114975fc915a0b4cfc35df6d525)) | ||
* param validation fixups ([4ce56b2](https://github.com/open-rpc/schema-utils-js/commit/4ce56b21f679ff60f192bef92bf06115a235ffe0)) | ||
* tests passing now ([6d82333](https://github.com/open-rpc/schema-utils-js/commit/6d8233320bfda6d56eeedecf4c79133bba327651)) | ||
## [1.12.2](https://github.com/open-rpc/schema-utils-js/compare/1.12.1...1.12.2) (2020-03-26) | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "@open-rpc/schema-utils-js", | ||
"private": false, | ||
"version": "1.12.2", | ||
"version": "1.12.3", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "build/src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77269
1038