Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow excluding certain violations from being reported #4

Merged
merged 5 commits into from
May 24, 2023

Conversation

pboos
Copy link
Collaborator

@pboos pboos commented May 24, 2023

Allow excluding certain violations using a custom ViolationExclusions bean.

For example:

@Component
public class ViolationExclusionsImpl implements ViolationExclusions {
    @Override
    public boolean isExcluded(OpenApiViolation violation) {
        return violation.getDirection().equals(Direction.REQUEST)
            && violation.getMessage().equals("[Path '/name'] Instance type (integer) does not match any allowed primitive type (allowed: [\"string\"])");
    }
}

@pboos pboos marked this pull request as ready for review May 24, 2023 09:48
@pboos pboos requested review from a team and ursulean May 24, 2023 09:48
@pboos pboos merged commit 08afebc into main May 24, 2023
@pboos pboos deleted the feature/violations-exclusion branch June 9, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants