Fix: Do not return violations with LogLevel.IGNORE#279
Merged
Conversation
…ture - Add comprehensive tests for filtering violations with LogLevel.IGNORE in both request and response validation - Organize tests using @nested and @DisplayName for better readability - Create createViolation helper method to reduce test code duplication - Tests verify that violations with LogLevel.IGNORE are not returned to prevent 400 errors 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…etter readability - Add createRequest() and createResponse() helper methods to reduce test setup duplication - Add mockRequestValidation() and mockResponseValidation() to simplify mock configuration - Add assertSingleViolationReturned() and assertNoViolationsReturned() assertion helpers - Simplify test methods by reducing boilerplate and improving focus on test intent 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
juliocastrodev
approved these changes
Oct 27, 2025
...ion-core/src/main/java/com/getyourguide/openapi/validation/core/OpenApiRequestValidator.java
Outdated
Show resolved
Hide resolved
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Violations configured with LogLevel.IGNORE were still being returned from validation, causing 400 errors to be sent to clients even though these violations were meant to be ignored. Example being additional query params which is set to ignored here.
Solution
Filter out violations with LogLevel.IGNORE in both request and response validation before returning results. This ensures that violations explicitly marked to be ignored do not trigger 400 Bad Request responses.
Changes