Created
December 4, 2017 17:59
-
-
Save kroo/9a003d92762d2740bca56b52f2d4956c to your computer and use it in GitHub Desktop.
Fix for infinite recursion in ReDoc 2.0.0-alpha.4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/services/models/Schema.ts b/src/services/models/Schema.ts | |
index c53219e..20cbabf 100644 | |
--- a/src/services/models/Schema.ts | |
+++ b/src/services/models/Schema.ts | |
@@ -67,11 +67,13 @@ export class SchemaModel { | |
this.schema = parser.mergeAllOf(this.rawSchema, this._$ref, isChild); | |
this.init(parser, isChild); | |
- parser.exitRef(schemaOrRef); | |
+ if (!this.isCircular) { | |
+ parser.exitRef(schemaOrRef); | |
- for (let $ref of this.schema.namedParents || []) { | |
- // exit all the refs visited during allOf traverse | |
- parser.exitRef({ $ref }); | |
+ for (let $ref of this.schema.namedParents || []) { | |
+ // exit all the refs visited during allOf traverse | |
+ parser.exitRef({ $ref }); | |
+ } | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment