You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hibernate Validator 9 deprecates @Valid on container fields, so the SDK logged HV000271: Using @Valid on a container (java.util.List) is deprecated whenever a request was validated. Validation itself still worked; this removes the warning.
Changes
Moved @Valid from List fields onto their element types (List<@Valid Address>, etc.) in MailtrapMail, MailtrapBatchMail, BatchEmailBase, InboundForwardRequest and InboundReplyRequest
Added a test checking that an invalid address inside the to list is still reported
Summary by CodeRabbit
Bug Fixes
Validation now checks each recipient, attachment, and batch email individually, reporting errors for invalid list entries.
Hibernate Validator 9 deprecates @Valid on container fields and logs
HV000271 at runtime. Put @Valid on the List element type instead, so
nested elements are still validated without the warning.
No actionable comments were generated in the recent review.
Walkthrough
The request models place @Valid on collection elements for addresses, attachments, and batch mail requests. A test checks that an invalid second recipient produces an error at to[1].email.
Email and inbound request models apply @Valid to collection elements. MailtrapMail.to retains @NotEmpty. The validator test checks the error path for an invalid second recipient.
This change moves nested validation onto list elements to avoid a Hibernate Validator 9 warning, and invalid recipients should still be reported. No concrete merge risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: @Valid moves from List fields onto the list element type arguments. The raw summary and PR objectives describe the same change across the five request classes. The tit…
Description check
The description states the motivation: Hibernate Validator 9 deprecates @Valid on container fields and logs HV000271, and this change removes that warning. It lists the changes to MailtrapMail, Mailtr…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: @Valid moves from List fields onto the list element type arguments. The raw summary and PR objectives describe the same change across the five request classes. The title is specific and matches the changeset.
Full details: Description check
Explanation
The description states the motivation: Hibernate Validator 9 deprecates @Valid on container fields and logs HV000271, and this change removes that warning. It lists the changes to MailtrapMail, MailtrapBatchMail, BatchEmailBase, InboundForwardRequest, and InboundReplyRequest, and it notes the added test. The description does not follow the template's required sections: it has no 'How to test' checklist and no 'Images and GIFs' section. The Motivation heading is present but is not labeled as such. Those gaps are minor, so the check passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Hibernate Validator 9 deprecates
@Validon container fields, so the SDK loggedHV000271: Using @Valid on a container (java.util.List) is deprecatedwhenever a request was validated. Validation itself still worked; this removes the warning.Changes
@ValidfromListfields onto their element types (List<@Valid Address>, etc.) inMailtrapMail,MailtrapBatchMail,BatchEmailBase,InboundForwardRequestandInboundReplyRequesttolist is still reportedSummary by CodeRabbit