Skip to content

Allow excluding certain violations from being reported - #4

Merged
pboos merged 5 commits into
mainfrom
feature/violations-exclusion
May 24, 2023
Merged

Allow excluding certain violations from being reported#4
pboos merged 5 commits into
mainfrom
feature/violations-exclusion

Conversation

@pboos

@pboos pboos commented May 24, 2023

Copy link
Copy Markdown
Contributor

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