mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 18:14:07 +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.pointer = activeDescendant.$ref;
|
||||||
this.schema = this.specMgr.byPointer(this.pointer);
|
this.schema = this.specMgr.byPointer(this.pointer);
|
||||||
|
this.normalizer.reset();
|
||||||
this.schema = this.normalizer.normalize(this.schema, this.normPointer,
|
this.schema = this.normalizer.normalize(this.schema, this.normPointer,
|
||||||
{resolved: true});
|
{resolved: true});
|
||||||
this.preprocessSchema();
|
this.preprocessSchema();
|
||||||
|
@ -119,7 +120,7 @@ export class JsonSchema extends BaseComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
trackByName(index: number, item: any): number {
|
trackByName(index: number, item: any): number {
|
||||||
return item.name;
|
return item.name + (item._pointer || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
|
@ -41,6 +41,10 @@ export class SchemaNormalizer {
|
||||||
res['x-redoc-normalized'] = true;
|
res['x-redoc-normalized'] = true;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reset() {
|
||||||
|
this._dereferencer.reset();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SchemaWalker {
|
class SchemaWalker {
|
||||||
|
@ -178,6 +182,9 @@ class SchemaDereferencer {
|
||||||
|
|
||||||
constructor(private _spec: SpecManager, private normalizator: SchemaNormalizer) {
|
constructor(private _spec: SpecManager, private normalizator: SchemaNormalizer) {
|
||||||
}
|
}
|
||||||
|
reset() {
|
||||||
|
this._refCouner.reset();
|
||||||
|
}
|
||||||
|
|
||||||
visit($ref) {
|
visit($ref) {
|
||||||
this._refCouner.visit($ref);
|
this._refCouner.visit($ref);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user