Closed Spark61 closed 6 months ago
It’s a patch operation. The validation should be performed after merging with the entity.
This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days
Overview of the issue
The
@Valid
annotation is not being generated for the patch request in the code. As a result, when a non-valid request is made, it results in a 500 error response instead of a more descriptive validation error.Motivation for or Use Case
This is crucial for providing a more descriptive and accurate error message to clients, helping in quicker debugging and ensuring better user experience.
Reproduce the error
@Valid
annotation in the patch request.Related issues
I've searched the issues both open and closed and couldn't find a similar problem. If it exists and I missed it, my apologies.
Suggest a Fix
Please add the
@Valid
annotation to the generated patch request to ensure validations are performed before processing the request.JHipster Version(s)
7.9.4
JHipster configuration
To replicate this issue, you can use the following JDL configuration:
JDL definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryThe configuration can be derived from the above JDL, specifically the
Test
entity and its validations.Browsers and Operating System
OS: Windows 11 This is not browser-specific.