fastify-txstate 3.3.4 → 3.3.5

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -0
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -262,6 +262,8 @@ class Server {
262
262
  for (const ov of v.params.errors) {
263
263
  if (['type', 'additionalProperties', 'minProperties'].includes(ov.keyword))
264
264
  developerErrors.push({ ...ov, message: v.message });
265
+ else if (ov.keyword === 'required')
266
+ userErrors.push({ ...ov, message: 'This field is required.' });
265
267
  else
266
268
  userErrors.push({ ...ov, message: v.message });
267
269
  }
@@ -269,6 +271,8 @@ class Server {
269
271
  else {
270
272
  if (['type', 'additionalProperties', 'minProperties'].includes(v.keyword))
271
273
  developerErrors.push(v);
274
+ else if (v.keyword === 'required')
275
+ userErrors.push({ ...v, message: 'This field is required.' });
272
276
  else
273
277
  userErrors.push(v);
274
278
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fastify-txstate",
3
- "version": "3.3.4",
3
+ "version": "3.3.5",
4
4
  "description": "A small wrapper for fastify providing a set of common conventions & utility functions we use.",
5
5
  "exports": {
6
6
  ".": {