@openaddresses/batch-schema 2.0.0 → 2.1.0

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/CHANGELOG.md CHANGED
@@ -10,6 +10,10 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v2.1.0
14
+
15
+ - :tada: Add more detailed schema error messages
16
+
13
17
  ### v2.0.0
14
18
 
15
19
  - :tada: Add support for populating `default` keys in schema
package/lib/schema.js CHANGED
@@ -241,17 +241,12 @@ class Schemas {
241
241
  this.router.use((err, req, res, next) => {
242
242
  if (err instanceof ValidationError) {
243
243
  let errs = [];
244
-
245
244
  if (err.validationErrors.body) {
246
- errs = errs.concat(err.validationErrors.body.map((e) => {
247
- return { message: e.message };
248
- }));
245
+ errs = errs.concat(err.validationErrors.body);
249
246
  }
250
247
 
251
248
  if (err.validationErrors.query) {
252
- errs = errs.concat(err.validationErrors.query.map((e) => {
253
- return { message: e.message };
254
- }));
249
+ errs = errs.concat(err.validationErrors.query);
255
250
  }
256
251
 
257
252
  return Err.respond(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openaddresses/batch-schema",
3
3
  "root": true,
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "description": "Strongly Validated JSON Schema support for address",
6
6
  "repository": "git@github.com:openaddresses/batch",
7
7
  "author": "ingalls <nick@ingalls.ca>",