Garzec
Explore posts from serversJCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
yes, I think I got this ( as shown in my code above )
56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
no, same for
INTERNAL_SERVER_ERROR
Is there some Spring magic required? Do I have to place this exception handler file into a specific directory with a conventional name or so...56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
yes, the default Spring behavior for invalid request bodies I guess
56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
if
/foo
is valid, it executes the rest handler, if it's invalid then Spring responds with a 400, so handleValidationException
never runs56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
sorry, the function
handleValidationException
never runs56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
yes please
56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
you only get a 400 with
56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
nothing, when I set a breakpoint, it won't run the function
56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
you mean like so?
That still doesn't work 😦
56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
@ayylmao123xdd thank you. I tried to follow the blog post and just changed from
@ControllerAdvice
to @RestControllerAdvice
since ErrorMessage
is just a custom type, I want to make use of problem details later on
Still, doesn't work 😦56 replies
JCHJava Community | Help. Code. Learn.
•Created by Garzec on 1/12/2025 in #java-help
How to apply request body validation with error details?
would you mind telling me how to do this?
ValidationExceptionHandler
is wrong?56 replies