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(
2020 FileInfo output ,
2121 OpenApiSpecVersion version ,
2222 OpenApiFormat format ,
23- string filterbyOperationIds ,
23+ string filterByOperationIds ,
2424 string filterByTags ,
2525 bool inline ,
2626 bool resolveExternal )
@@ -44,9 +44,14 @@ public static void ProcessOpenApiDocument(
4444 document = result . OpenApiDocument ;
4545
4646 // Check if filter options are provided, then execute
47- if ( ! string . IsNullOrEmpty ( filterbyOperationIds ) )
47+ if ( ! string . IsNullOrEmpty ( filterByOperationIds ) && ! string . IsNullOrEmpty ( filterByTags ) )
4848 {
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 ) ;
5055 document = OpenApiFilterService . CreateFilteredDocument ( document , predicate ) ;
5156 }
5257 if ( ! string . IsNullOrEmpty ( filterByTags ) )
You can’t perform that action at this time.
0 commit comments