Skip to content

Conversation

@sandipk09roy-pixel
Copy link
Owner

Closes #1

Summary

This pull request introduces a Spring Boot module that demonstrates custom validation using @Valid, @RequestBody, and BindingResult. It provides a reproducible example for students and collaborators to understand field-level validation and structured error handling in REST APIs.

Features

  • UserDTO with annotations: @Email, @Size, @NotBlank, @Min
  • UserController with validation logic and error response formatting
  • LogbackPing class to ensure compatibility with logback-core packaging
  • Entry point via SpringBootCustomValidationApplication.java
  • Compatible with Spring Boot 3.2.5 and Java 21

How to Test

curl -X POST http://localhost:8081/register \
     -H "Content-Type: application/json" \
     -d "{\"email\":\"invalid-email\",\"password\":\"short\"}"

Expected response:

[
  "Please provide a valid email address.",
  "Name must not be blank.",
  "Age must be at least 18."
]
Notes
- No external configuration required
- Designed for onboarding and reproducibility
- Ideal for student learning and collaborative extension

@sandipk09roy-pixel
Copy link
Owner Author

@sandipk09roy-pixel would love your feedback on this validation module — designed for onboarding and reproducibility.

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.

Add Spring Boot Custom Validation Module with Logback Compatibility

2 participants