joi-to-json 2.3.1 → 2.3.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.
@@ -29,7 +29,7 @@ class JoiJsonSchemaParser {
29
29
  this._setAnyProperties(schema, joiSpec, definitions, level)
30
30
  this._addNullTypeIfNullable(schema, joiSpec)
31
31
  this._setMetaProperties(schema, joiSpec)
32
- this._setLinkFieldProperties(schema, joiSpec)
32
+ this._setLinkFieldProperties(schema, joiSpec, definitions, level)
33
33
 
34
34
  const schemaId = _.get(joiSpec, 'flags.id')
35
35
  if (schemaId) {
@@ -441,7 +441,7 @@ class JoiJsonSchemaParser {
441
441
  })
442
442
  }
443
443
 
444
- _setLinkFieldProperties(schema, joiSpec) {
444
+ _setLinkFieldProperties(schema, joiSpec, definitions, level) {
445
445
  if (schema.type !== 'link') {
446
446
  return
447
447
  }
@@ -450,6 +450,10 @@ class JoiJsonSchemaParser {
450
450
  schema.$ref = `${this._getLocalSchemaBasePath()}/${joiSpec.link.ref.path.join('/')}`
451
451
  delete schema.type
452
452
  }
453
+
454
+ if (!_.isEmpty(joiSpec.shared)) {
455
+ this.parse(joiSpec.shared[0], definitions, level)
456
+ }
453
457
  }
454
458
  }
455
459
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joi-to-json",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "joi to JSON / OpenAPI Schema Converter",
5
5
  "main": "index.js",
6
6
  "repository": {