You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated.
648
+
The `FILTER` parameter allows selective inclusion of API operations based on specific criteria. It applies the `x-internal: true` property to operations that do **not** match the specified values, preventing them from being generated. Multiple filters can be separated by a semi-column.
649
649
650
650
### Available Filters
651
651
@@ -658,14 +658,17 @@ The `FILTER` parameter allows selective inclusion of API operations based on spe
658
658
- **`tag`**
659
659
When set to `tag:person|basic`, operations **not** tagged with `person` or `basic` will be marked as internal (`x-internal: true`), and will not be generated.
660
660
661
+
- **`path`**
662
+
When set to `path:/v1|/v2`, operations on paths **not** starting with `/v1` or with `/v2` will be marked as internal (`x-internal: true`), and will not be generated.
if (filterStrs.length != 2) { // only support operationId with : at the moment
281
-
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3`: {}", inputRules.get(FILTER));
300
-
}
275
+
Stringfilters = inputRules.get(FILTER);
276
+
try {
277
+
filter = newFilter(filters);
278
+
} catch (Exceptione) {
279
+
LOGGER.error("FILTER rule must be in the form of `operationId:name1|name2|name3` or `method:get|post|put` or `tag:tag1|tag2|tag3` or `path:/v1|/v2` in {}", filters);
// Iterates over each HTTP method in methodMap, retrieves the corresponding Operation from the PathItem,
409
-
// and marks it as internal (`x-internal`) if the method is not in methodFilters.
410
-
methodMap.forEach((method, getter) -> {
411
-
Operationoperation = getter.apply(path);
412
-
if (operation != null && !methodFilters.isEmpty()) {
413
-
LOGGER.info("operation `{}` marked internal only (x-internal: `{}`) by the method FILTER", operation.getOperationId(), !methodFilters.contains(method));
0 commit comments