File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/Microsoft.OpenApi.Tool Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public static void ProcessOpenApiDocument(
20
20
FileInfo output ,
21
21
OpenApiSpecVersion version ,
22
22
OpenApiFormat format ,
23
- string filterbyOperationIds ,
23
+ string filterByOperationIds ,
24
24
string filterByTags ,
25
25
bool inline ,
26
26
bool resolveExternal )
@@ -44,9 +44,14 @@ public static void ProcessOpenApiDocument(
44
44
document = result . OpenApiDocument ;
45
45
46
46
// Check if filter options are provided, then execute
47
- if ( ! string . IsNullOrEmpty ( filterbyOperationIds ) )
47
+ if ( ! string . IsNullOrEmpty ( filterByOperationIds ) && ! string . IsNullOrEmpty ( filterByTags ) )
48
48
{
49
- var predicate = OpenApiFilterService . CreatePredicate ( operationIds : filterbyOperationIds ) ;
49
+ throw new InvalidOperationException ( "Cannot filter by operationIds and tags at the same time." ) ;
50
+ }
51
+
52
+ if ( ! string . IsNullOrEmpty ( filterByOperationIds ) )
53
+ {
54
+ var predicate = OpenApiFilterService . CreatePredicate ( operationIds : filterByOperationIds ) ;
50
55
document = OpenApiFilterService . CreateFilteredDocument ( document , predicate ) ;
51
56
}
52
57
if ( ! string . IsNullOrEmpty ( filterByTags ) )
You can’t perform that action at this time.
0 commit comments