@@ -31,18 +31,25 @@ public OperationSearch(Func<string, OperationType?,OpenApiOperation, bool> predi
3131 }
3232
3333 /// <summary>
34- /// Visits <see cref="OpenApiOperation "/>.
34+ /// Visits <see cref="OpenApiPathItem "/>
3535 /// </summary>
36- /// <param name="operation"> The target <see cref="OpenApiOperation "/>.</param>
37- public override void Visit ( OpenApiOperation operation )
36+ /// <param name="pathItem"> The target <see cref="OpenApiPathItem "/>.</param>
37+ public override void Visit ( OpenApiPathItem pathItem )
3838 {
39- if ( _predicate ( CurrentKeys . Path , CurrentKeys . Operation , operation ) )
39+ foreach ( var item in pathItem . Operations )
4040 {
41- _searchResults . Add ( new SearchResult ( )
41+ var operation = item . Value ;
42+ var operationType = item . Key ;
43+
44+ if ( _predicate ( CurrentKeys . Path , CurrentKeys . Operation , operation ) )
4245 {
43- Operation = operation ,
44- CurrentKeys = CopyCurrentKeys ( CurrentKeys )
45- } ) ;
46+ _searchResults . Add ( new SearchResult ( )
47+ {
48+ Operation = operation ,
49+ Parameters = pathItem . Parameters ,
50+ CurrentKeys = CopyCurrentKeys ( CurrentKeys , operationType )
51+ } ) ;
52+ }
4653 }
4754 }
4855
@@ -65,12 +72,12 @@ public override void Visit(IList<OpenApiParameter> parameters)
6572 base . Visit ( parameters ) ;
6673 }
6774
68- private static CurrentKeys CopyCurrentKeys ( CurrentKeys currentKeys )
75+ private static CurrentKeys CopyCurrentKeys ( CurrentKeys currentKeys , OperationType operationType )
6976 {
7077 return new CurrentKeys
7178 {
7279 Path = currentKeys . Path ,
73- Operation = currentKeys . Operation
80+ Operation = operationType
7481 } ;
7582 }
7683 }
0 commit comments