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.
@@ -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, definitions, level)
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, definitions, level) {
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joi-to-json",
3
- "version": "2.3.2",
3
+ "version": "2.3.3",
4
4
  "description": "joi to JSON / OpenAPI Schema Converter",
5
5
  "main": "index.js",
6
6
  "repository": {