Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fix for infinite recursion in ReDoc 2.0.0-alpha.4
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
You can’t perform that action at this time.