@trojs/openapi-dereference 0.2.2 → 0.2.4

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trojs/openapi-dereference",
3
3
  "description": "OpenAPI dereference",
4
- "version": "0.2.2",
4
+ "version": "0.2.4",
5
5
  "author": {
6
6
  "name": "Pieter Wigboldus",
7
7
  "url": "https://trojs.org/"
@@ -33,7 +33,7 @@
33
33
  "eslint": "^8.23.0",
34
34
  "eslint-config-standard": "^17.1.0",
35
35
  "eslint-plugin-import": "^2.26.0",
36
- "eslint-plugin-jsdoc": "^48.0.0",
36
+ "eslint-plugin-jsdoc": "^50.0.0",
37
37
  "eslint-plugin-n": "^16.0.0",
38
38
  "eslint-plugin-promise": "^6.0.1",
39
39
  "eslint-plugin-sonarjs": "^0.25.0",
@@ -40,7 +40,11 @@ export const dereferenceSync = (schema) => {
40
40
  } else {
41
41
  // object
42
42
  if ('$ref' in current && typeof current.$ref === 'string') {
43
- return resolveRefSync(cloned, current.$ref)
43
+ let ref = current
44
+ do {
45
+ ref = resolveRefSync(cloned, ref.$ref)
46
+ } while (ref?.$ref)
47
+ return ref
44
48
  }
45
49
 
46
50
  for (const key in current) {