mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
Fix schema collapse after change discriminator
This commit is contained in:
parent
c768512913
commit
39db6e8462
|
@ -47,6 +47,7 @@ export class JsonSchema extends BaseComponent implements OnInit {
|
|||
|
||||
this.pointer = activeDescendant.$ref;
|
||||
this.schema = this.specMgr.byPointer(this.pointer);
|
||||
this.normalizer.reset();
|
||||
this.schema = this.normalizer.normalize(this.schema, this.normPointer,
|
||||
{resolved: true});
|
||||
this.preprocessSchema();
|
||||
|
@ -119,7 +120,7 @@ export class JsonSchema extends BaseComponent implements OnInit {
|
|||
}
|
||||
|
||||
trackByName(index: number, item: any): number {
|
||||
return item.name;
|
||||
return item.name + (item._pointer || '');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
|
|
@ -41,6 +41,10 @@ export class SchemaNormalizer {
|
|||
res['x-redoc-normalized'] = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
reset() {
|
||||
this._dereferencer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
class SchemaWalker {
|
||||
|
@ -178,6 +182,9 @@ class SchemaDereferencer {
|
|||
|
||||
constructor(private _spec: SpecManager, private normalizator: SchemaNormalizer) {
|
||||
}
|
||||
reset() {
|
||||
this._refCouner.reset();
|
||||
}
|
||||
|
||||
visit($ref) {
|
||||
this._refCouner.visit($ref);
|
||||
|
|
Loading…
Reference in New Issue
Block a user