File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,12 @@ import { IMenuItem } from '../MenuStore';
4
4
import { GroupModel } from './Group.model' ;
5
5
import { SecurityRequirementModel } from './SecurityRequirement' ;
6
6
7
- import { OpenAPIExternalDocumentation , OpenAPIServer , OpenAPIXCodeSample } from '../../types' ;
7
+ import {
8
+ OpenAPIExternalDocumentation ,
9
+ OpenAPIPath ,
10
+ OpenAPIServer ,
11
+ OpenAPIXCodeSample ,
12
+ } from '../../types' ;
8
13
9
14
import {
10
15
getOperationSummary ,
@@ -83,9 +88,14 @@ export class OperationModel implements IMenuItem {
83
88
this . operationId = operationSpec . operationId ;
84
89
this . codeSamples = operationSpec [ 'x-code-samples' ] || [ ] ;
85
90
this . path = operationSpec . pathName ;
91
+
92
+ const pathInfo = parser . byRef < OpenAPIPath > (
93
+ JsonPointer . compile ( [ 'paths' , operationSpec . pathName ] ) ,
94
+ ) ;
95
+
86
96
this . servers = normalizeServers (
87
97
parser . specUrl ,
88
- operationSpec . servers || parser . spec . servers || [ ] ,
98
+ operationSpec . servers || ( pathInfo && pathInfo . servers ) || parser . spec . servers || [ ] ,
89
99
) ;
90
100
91
101
this . security = ( operationSpec . security || parser . spec . security || [ ] ) . map (
You can’t perform that action at this time.
0 commit comments