File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -453,6 +453,13 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
453
453
*/
454
454
_computeDeclById ( model : any , selected : string ) : any | undefined ;
455
455
456
+ /**
457
+ * Computes model of a shape defined in `references` list
458
+ * @param model AMF model
459
+ * @param selected Current selection
460
+ */
461
+ _computeRefById ( model , selected ) : any | undefined ;
462
+
456
463
_isTypeFragment ( model : any ) : boolean ;
457
464
458
465
_isTypePartialModel ( model : any ) : boolean ;
Original file line number Diff line number Diff line change @@ -619,16 +619,25 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
619
619
_computeTypeLibraryModel ( model , selected ) {
620
620
let declModel = this . _computeDeclById ( model , selected )
621
621
if ( ! declModel ) {
622
- const references = this . _computeReferences ( model ) ;
623
- if ( references ) {
624
- // @ts -ignore
625
- const declarationsInRef = references . map ( ( r ) => this . _computeDeclares ( r ) ) . flat ( ) ;
626
- declModel = this . _findById ( declarationsInRef , selected ) ;
627
- }
622
+ declModel = this . _computeRefById ( model , selected ) ;
628
623
}
629
624
return declModel ;
630
625
}
631
626
627
+ /**
628
+ * Computes model of a shape defined in `references` list
629
+ * @param model AMF model
630
+ * @param selected Current selection
631
+ */
632
+ _computeRefById ( model , selected ) {
633
+ const references = this . _computeReferences ( model ) ;
634
+ if ( ! references ) {
635
+ return undefined ;
636
+ }
637
+ const declarationsInRef = references . map ( ( r ) => this . _computeDeclares ( r ) ) . flat ( ) ;
638
+ return this . _findById ( declarationsInRef , selected ) ;
639
+ }
640
+
632
641
/**
633
642
* Extracts security model from security scheme fragment and sets current selection
634
643
* and the model.
You can’t perform that action at this time.
0 commit comments