Skip to content

Conversation

@theEvilReaper
Copy link
Contributor

Proposed changes

Recent commits removed the existing validation layer for DTOs. While this is acceptable for now, it’s not sustainable in the long run. This pull request introduces a new validation layer that works better for each case

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@theEvilReaper theEvilReaper force-pushed the feature/betterValidation branch from a61daaa to 09617cc Compare November 4, 2025 15:17
@theEvilReaper theEvilReaper self-assigned this Nov 4, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Jakarta Bean Validation annotations to DTOs and implements comprehensive validation test coverage. The changes introduce field-level validation constraints (e.g., @NotBlank, @Positive, @PositiveOrZero) to ensure data integrity at the API layer.

  • Added Jakarta Validation and Hibernate Validator dependencies
  • Annotated DTO fields with validation constraints (@NotBlank, @NotEmpty, @Positive, @PositiveOrZero, @Nullable)
  • Created a base validation test class and comprehensive validation tests for all DTOs
  • Fixed field naming inconsistency (descriptioncomment in NotificationModelDTO)

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
settings.gradle.kts Added version definitions for hibernate-validator (9.0.1.Final) and jakarta.validation-api (3.1.1)
build.gradle.kts Added validation library dependencies to testImplementation and reordered testRuntimeOnly
ValidationTestBase.java Created abstract base class with helper methods for validation testing using Jakarta Validator
SoundFileSourceDTO.java Added validation constraints for name, volume, pitch, weight, attenuationDistance, and type fields
SoundEventDTO.java Added @notblank and @NotNull constraints to uiName, variableName, keyName, and subTitle fields
NotificationModelDTO.java Added validation constraints and renamed field from "description" to "comment"
ItemModelDTO.java Added validation constraints for string fields and numeric fields (customModelData, amount)
FontModelDTO.java Added validation constraints for string fields, marked comment as @nullable, added @PositiveOrZero for ascent/height
AttributeModelDTO.java Added validation constraints for string fields and numeric constraints for defaultValue and maximumValue
SoundFileSourceDTOValidationTest.java Created comprehensive tests validating blank/negative constraints on all fields
SoundEventDTOValidationTest.java Created tests validating blank string constraints on all required fields
NotificationModelDTOValidationTest.java Created tests validating blank string constraints on all required fields
ItemModelDTOValidationTest.java Created tests validating blank strings, negative numbers, and comment nullability
FontModelDTOValidationTest.java Created tests validating blank strings and negative numeric values
AttributeModelDTOValidationTest.java Created tests validating empty strings and numeric constraints

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@TheMeinerLP TheMeinerLP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@theEvilReaper theEvilReaper merged commit 57f12b4 into beta Nov 4, 2025
4 checks passed
@theEvilReaper theEvilReaper deleted the feature/betterValidation branch November 4, 2025 20:24
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