File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,15 @@ export interface IOperationParser {
1010 action ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : string
1111
1212 description ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : string
13+
14+ shouldSkip ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : boolean ;
1315}
1416
1517export class DefaultOperationParser implements IOperationParser {
18+ shouldSkip ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : boolean {
19+ return ! ! operation . deprecated
20+ }
21+
1622 name ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : string {
1723 return lodash . startCase ( operation . operationId )
1824 }
Original file line number Diff line number Diff line change @@ -76,6 +76,10 @@ export class BaseOperationsCollector implements OpenAPIVisitor {
7676 }
7777
7878 _visitOperation ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) {
79+ if ( this . operationParser . shouldSkip ( operation , context ) ) {
80+ this . logger . info ( this . bindings , 'Skipping operation' )
81+ return
82+ }
7983 const { option, fields : operationFields } = this . parseOperation ( operation , context ) ;
8084 const resources = operation . tags ! ! . map ( ( tag : string ) => this . resourceParser . value ( { name : tag } ) )
8185 for ( const resourceName of resources ) {
@@ -150,13 +154,6 @@ export class BaseOperationsCollector implements OpenAPIVisitor {
150154}
151155
152156export class OperationsCollector extends BaseOperationsCollector {
153- visitOperation ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) {
154- if ( operation . deprecated ) {
155- return ;
156- }
157- super . visitOperation ( operation , context ) ;
158- }
159-
160157 protected parseOperation ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) {
161158 const result = super . parseOperation ( operation , context )
162159 const notice : INodeProperties = {
You can’t perform that action at this time.
0 commit comments