joi-to-json 2.3.2 → 2.3.3
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/lib/parsers/json.js +6 -6
- package/package.json +1 -1
package/lib/parsers/json.js
CHANGED
|
@@ -29,7 +29,11 @@ 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)
|
|
33
|
+
|
|
34
|
+
if (!_.isEmpty(joiSpec.shared)) {
|
|
35
|
+
this.parse(joiSpec.shared[0], definitions, level)
|
|
36
|
+
}
|
|
33
37
|
|
|
34
38
|
const schemaId = _.get(joiSpec, 'flags.id')
|
|
35
39
|
if (schemaId) {
|
|
@@ -441,7 +445,7 @@ class JoiJsonSchemaParser {
|
|
|
441
445
|
})
|
|
442
446
|
}
|
|
443
447
|
|
|
444
|
-
_setLinkFieldProperties(schema, joiSpec
|
|
448
|
+
_setLinkFieldProperties(schema, joiSpec) {
|
|
445
449
|
if (schema.type !== 'link') {
|
|
446
450
|
return
|
|
447
451
|
}
|
|
@@ -450,10 +454,6 @@ class JoiJsonSchemaParser {
|
|
|
450
454
|
schema.$ref = `${this._getLocalSchemaBasePath()}/${joiSpec.link.ref.path.join('/')}`
|
|
451
455
|
delete schema.type
|
|
452
456
|
}
|
|
453
|
-
|
|
454
|
-
if (!_.isEmpty(joiSpec.shared)) {
|
|
455
|
-
this.parse(joiSpec.shared[0], definitions, level)
|
|
456
|
-
}
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
459
|
|