json-2-joi 3.0.1 → 3.0.2

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/resolver.js +3 -0
  2. package/package.json +1 -1
package/lib/resolver.js CHANGED
@@ -74,6 +74,9 @@ function allowNullIfNeeded(schema, { allowNull = false, forbidArrayNull = true,
74
74
  // Already has enum restriction
75
75
  return schema;
76
76
  }
77
+ if (!schema.type && (schema.allOf || schema.anyOf || schema.oneOf || schema.not)) {
78
+ return schema;
79
+ }
77
80
  if (forbidArrayNull && schema.type === 'array') {
78
81
  return schema;
79
82
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-2-joi",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "license": "Apache 2.0",
5
5
  "description": "Converts json-schema to Joi schema. (Enhanced enjoi)",
6
6
  "main": "./index.js",