json-2-joi 2.0.0 → 2.0.1

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
@@ -1,3 +1,7 @@
1
+ ### 2.0.1
2
+
3
+ - Set correct examples data for Array type field.
4
+
1
5
  ### 2.0.0
2
6
 
3
7
  * [BREAKING] Remove `useDefaults` and `strictMode` options
package/lib/resolver.js CHANGED
@@ -373,7 +373,7 @@ class SchemaResolver {
373
373
  example = schema.enum[0];
374
374
  }
375
375
  if (example) {
376
- joischema = joischema.example(example);
376
+ joischema = joischema.type === 'array' && !Array.isArray(example) ? joischema.example([example]) : joischema.example(example);
377
377
  }
378
378
 
379
379
  return joischema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-2-joi",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "license": "Apache 2.0",
5
5
  "description": "Converts json-schema to Joi schema.",
6
6
  "main": "./index.js",