Skip to content

Conversation

@pboos
Copy link
Contributor

@pboos pboos commented Oct 27, 2025

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

  • Added filtering for LogLevel.IGNORE violations in OpenApiRequestValidator.validateRequestObject() and validateResponseObject()
  • Added comprehensive test coverage for the filtering logic
  • Organized tests using @nested and @DisplayName for better readability
  • Updated deprecated @SpyBean to @MockitoSpyBean

pboos and others added 5 commits October 27, 2025 17:57
…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 <[email protected]>
…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 <[email protected]>
@pboos pboos changed the title fix: 400 on additional query param Fix: Do not return violations with LogLevel.IGNORE Oct 27, 2025
@pboos pboos marked this pull request as ready for review October 27, 2025 17:46
@pboos pboos requested a review from a team as a code owner October 27, 2025 17:46
@pboos pboos requested a review from anacotirlea October 27, 2025 17:46
@pboos pboos merged commit edd9c22 into main Oct 28, 2025
4 of 5 checks passed
@pboos pboos deleted the fix/no-400-on-additional-query-param branch October 28, 2025 05:53
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.

3 participants