Skip to content

Commit 23d6605

Browse files
committed
OpenAPINormalizer fails for invalid FILTER syntax
1 parent 99c9751 commit 23d6605

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,11 @@ public void processRules(Map<String, String> inputRules) {
275275
String filters = inputRules.get(FILTER);
276276
try {
277277
filter = new Filter(filters);
278-
} catch (Exception e) {
278+
} catch (RuntimeException e) {
279279
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);
280+
// rethrow the exception. This is a breaking change compared to pre 7.16.0
281+
// Workaround: fix the syntax!
282+
throw e;
280283
}
281284
}
282285

@@ -1792,7 +1795,7 @@ public Filter(String filters) {
17921795
for (String filter : filters.split(";")) {
17931796
filter = filter.trim();
17941797
String[] filterStrs = filter.split(":");
1795-
if (filterStrs.length != 2) { // only support operationId with : at the moment
1798+
if (filterStrs.length != 2) { // only support filter with : at the moment
17961799
throw new IllegalArgumentException("filter not supported :[" + filter + "]");
17971800
} else {
17981801
String filterKey = filterStrs[0].trim();

0 commit comments

Comments
 (0)