@shushed/helpers 0.0.146 → 0.0.147
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/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -168896,12 +168896,18 @@ function validate(payload, schema40, options) {
|
|
|
168896
168896
|
(0, import_ajv_formats.default)(ajv);
|
|
168897
168897
|
const validate2 = ajv.compile(schema40);
|
|
168898
168898
|
if (!validate2(payload)) {
|
|
168899
|
-
const errors = validate2.errors?.map((error) => `${error.instancePath} ${error.message}
|
|
168899
|
+
const errors = validate2.errors?.map((error) => `${error.instancePath} ${error.message}: ${JSON.stringify({
|
|
168900
|
+
keyword: error.keyword,
|
|
168901
|
+
instancePath: error.instancePath,
|
|
168902
|
+
schemaPath: error.instancePath,
|
|
168903
|
+
params: error.params,
|
|
168904
|
+
propertyName: error.propertyName
|
|
168905
|
+
})}`) || [];
|
|
168900
168906
|
options.log.error(
|
|
168901
|
-
`Payload validation failed for object type '${schema40.title || schema40.$id}' because it did not match the expected schema
|
|
168907
|
+
`Payload validation failed for object type '${schema40.title || schema40.$id}' because it did not match the expected schema.` + errors.join("\n")
|
|
168902
168908
|
);
|
|
168903
168909
|
throw new Error(
|
|
168904
|
-
`Payload validation failed for object type '${schema40.title || schema40.$id}' because it did not match the expected schema
|
|
168910
|
+
`Payload validation failed for object type '${schema40.title || schema40.$id}' because it did not match the expected schema` + errors.join("\n")
|
|
168905
168911
|
);
|
|
168906
168912
|
} else {
|
|
168907
168913
|
return payload;
|