-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow excluding certain violations from being reported (#4)
- Loading branch information
Showing
11 changed files
with
124 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...c/main/java/com/getyourguide/openapi/validation/api/exclusions/NoViolationExclusions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.getyourguide.openapi.validation.api.exclusions; | ||
|
||
import com.getyourguide.openapi.validation.api.model.OpenApiViolation; | ||
|
||
public class NoViolationExclusions implements ViolationExclusions { | ||
@Override | ||
public boolean isExcluded(OpenApiViolation violation) { | ||
return false; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...src/main/java/com/getyourguide/openapi/validation/api/exclusions/ViolationExclusions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.getyourguide.openapi.validation.api.exclusions; | ||
|
||
import com.getyourguide.openapi.validation.api.model.OpenApiViolation; | ||
|
||
public interface ViolationExclusions { | ||
boolean isExcluded(OpenApiViolation violation); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...ain/java/com/getyourguide/openapi/validation/core/throttle/ValidationReportThrottler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
package com.getyourguide.openapi.validation.core.throttle; | ||
|
||
import com.atlassian.oai.validator.report.ValidationReport; | ||
import com.getyourguide.openapi.validation.api.model.Direction; | ||
import com.getyourguide.openapi.validation.api.model.OpenApiViolation; | ||
|
||
public interface ValidationReportThrottler { | ||
|
||
void throttle(ValidationReport.Message message, Direction direction, Runnable runnable); | ||
void throttle(OpenApiViolation openApiViolation, Runnable runnable); | ||
} |
5 changes: 2 additions & 3 deletions
5
...java/com/getyourguide/openapi/validation/core/throttle/ValidationReportThrottlerNone.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
package com.getyourguide.openapi.validation.core.throttle; | ||
|
||
import com.atlassian.oai.validator.report.ValidationReport; | ||
import com.getyourguide.openapi.validation.api.model.Direction; | ||
import com.getyourguide.openapi.validation.api.model.OpenApiViolation; | ||
|
||
public class ValidationReportThrottlerNone implements ValidationReportThrottler { | ||
@Override | ||
public void throttle(ValidationReport.Message message, Direction direction, Runnable runnable) { | ||
public void throttle(OpenApiViolation openApiViolation, Runnable runnable) { | ||
runnable.run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.