Skip to content

Commit

Permalink
[bugfix] 405 with operation.notAllowed should be excluded
Browse files Browse the repository at this point in the history
  • Loading branch information
pboos committed Oct 17, 2023
1 parent 3e35102 commit e04eebd
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class InternalViolationExclusions {
public boolean isExcluded(OpenApiViolation violation) {
return falsePositive404(violation)
|| falsePositive400(violation)
|| falsePositive405(violation)
|| customViolationExclusions.isExcluded(violation)
|| oneOfMatchesMoreThanOneSchema(violation);
}
Expand All @@ -36,4 +37,9 @@ private boolean falsePositive404(OpenApiViolation violation) {
private boolean falsePositive400(OpenApiViolation violation) {
return violation.getDirection() == Direction.REQUEST && violation.getResponseStatus().orElse(0) == 400;
}

private boolean falsePositive405(OpenApiViolation violation) {
return violation.getResponseStatus().orElse(0) == 405
&& "validation.request.operation.notAllowed".equals(violation.getRule());
}
}

0 comments on commit e04eebd

Please sign in to comment.