@openaddresses/batch-schema 10.19.0 → 10.21.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,14 @@
10
10
 
11
11
  ## Version History
12
12
 
13
+ ### v10.21.0
14
+
15
+ - :rocket: Surface outgoing schema errors in the logs
16
+
17
+ ### v10.20.0
18
+
19
+ - :arrow_up: Update Core Types
20
+
13
21
  ### v10.19.0
14
22
 
15
23
  - :rocket: Allow passing through morgan options
package/lib/schema.ts CHANGED
@@ -166,6 +166,7 @@ export default class Schemas {
166
166
  obj = JSON.parse(JSON.stringify(obj)) // Here as Date => String needs to happen
167
167
  if ((res.statusCode === null || res.statusCode === 200) && resValidation && !resValidation(obj)) {
168
168
  res.status(400);
169
+ console.error(`Response Validation Error: ${JSON.stringify(obj)}`);
169
170
  return json.call(this, { type: 'Response', errors: resValidation.errors as ErrorObject[] });
170
171
  } else {
171
172
  return json.call(this, obj);
@@ -213,6 +214,7 @@ export default class Schemas {
213
214
  obj = JSON.parse(JSON.stringify(obj)) // Here as Date => String needs to happen
214
215
  if ((res.statusCode === null || res.statusCode === 200) && resValidation && !resValidation(obj)) {
215
216
  res.status(400);
217
+ console.error(`Response Validation Error: ${JSON.stringify(obj)}`);
216
218
  return json.call(this, { type: 'Response', errors: resValidation.errors as ErrorObject[] });
217
219
  } else {
218
220
  return json.call(this, obj);
@@ -261,6 +263,7 @@ export default class Schemas {
261
263
  obj = JSON.parse(JSON.stringify(obj)) // Here as Date => String needs to happen
262
264
  if ((res.statusCode === null || res.statusCode === 200) && resValidation && !resValidation(obj)) {
263
265
  res.status(400);
266
+ console.error(`Response Validation Error: ${JSON.stringify(obj)}`);
264
267
  return json.call(this, { type: 'Response', errors: resValidation.errors as ErrorObject[] });
265
268
  } else {
266
269
  return json.call(this, obj);
@@ -309,6 +312,7 @@ export default class Schemas {
309
312
  obj = JSON.parse(JSON.stringify(obj)) // Here as Date => String needs to happen
310
313
  if ((res.statusCode === null || res.statusCode === 200) && resValidation && !resValidation(obj)) {
311
314
  res.status(400);
315
+ console.error(`Response Validation Error: ${JSON.stringify(obj)}`);
312
316
  return json.call(this, { type: 'Response', errors: resValidation.errors as ErrorObject[] });
313
317
  } else {
314
318
  return json.call(this, obj);
@@ -357,6 +361,7 @@ export default class Schemas {
357
361
  obj = JSON.parse(JSON.stringify(obj)) // Here as Date => String needs to happen
358
362
  if ((res.statusCode === null || res.statusCode === 200) && resValidation && !resValidation(obj)) {
359
363
  res.status(400);
364
+ console.error(`Response Validation Error: ${JSON.stringify(obj)}`);
360
365
  return json.call(this, { type: 'Response', errors: resValidation.errors as ErrorObject[] });
361
366
  } else {
362
367
  return json.call(this, obj);
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "root": true,
5
5
  "main": "dist/index.js",
6
6
  "types": "index.ts",
7
- "version": "10.19.0",
7
+ "version": "10.21.0",
8
8
  "description": "Strongly Validated JSON Schema support for address",
9
9
  "repository": "git@github.com:openaddresses/batch-schema",
10
10
  "author": "ingalls <nick@ingalls.ca>",
@@ -29,7 +29,7 @@
29
29
  "ajv-formats": "^3.0.1",
30
30
  "body-parser": "^2.2.0",
31
31
  "express": "^5.0.0",
32
- "glob": "^11.0.0",
32
+ "glob": "^13.0.0",
33
33
  "morgan": "^1.10.0",
34
34
  "openapi-types": "^12.1.3"
35
35
  },