File tree 2 files changed +15
-10
lines changed
src/Swashbuckle.AspNetCore.ApiTesting
test/WebSites/TestFirst.IntegrationTests
2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -11,17 +11,23 @@ internal static bool TryFindOperationById(
11
11
out string pathTemplate ,
12
12
out HttpMethod operationType )
13
13
{
14
- foreach ( var pathEntry in openApiDocument . Paths ?? [ ] )
14
+ if ( openApiDocument . Paths is { Count : > 0 } paths )
15
15
{
16
- var pathItem = pathEntry . Value ;
17
-
18
- foreach ( var operationEntry in pathItem . Operations )
16
+ foreach ( var pathEntry in paths )
19
17
{
20
- if ( operationEntry . Value . OperationId == operationId )
18
+ var pathItem = pathEntry . Value ;
19
+
20
+ if ( pathItem . Operations is { Count : > 0 } operations )
21
21
{
22
- pathTemplate = pathEntry . Key ;
23
- operationType = operationEntry . Key ;
24
- return true ;
22
+ foreach ( var operation in operations )
23
+ {
24
+ if ( operation . Value . OperationId == operationId )
25
+ {
26
+ pathTemplate = pathEntry . Key ;
27
+ operationType = operation . Key ;
28
+ return true ;
29
+ }
30
+ }
25
31
}
26
32
}
27
33
}
Original file line number Diff line number Diff line change @@ -56,5 +56,4 @@ private static string GetSolutionRelativeContentRoot(
56
56
}
57
57
58
58
[ CollectionDefinition ( "ApiTests" ) ]
59
- public class ApiTestsCollection : ICollectionFixture < ApiTestRunner >
60
- { }
59
+ public class ApiTestsCollection : ICollectionFixture < ApiTestRunner > ;
You can’t perform that action at this time.
0 commit comments