spring-validator Questions

2

We are able to use openApi documentation and generate our Java Input classes using the spring swagger-codegen. Also, we can inject the javax.validation annotations when input is generated for commo...

2

Solved

I have following simple project to test spring boot validation. I am using Spring boot version 2.5.6 Validation dependency in pom.xml <dependency> <groupId>org.springframework.boot<...
Intoxicated asked 3/12, 2021 at 9:38

4

Solved

In my Spring Application, i'm Using Hibernate Validator for Validation Purpose. When i'm doing simple Validation like @NotEmpty, @Email .. i'm easily working But When coming to Date field, givin...
Kibitka asked 1/5, 2013 at 11:22

5

Solved

I have been trying to add spring validators to a spring-data-rest project. I followed along and setup the "getting started" application via this link: http://spring.io/guides/gs/accessing-data-res...
Dependent asked 20/6, 2014 at 0:47

3

When I use BindingResult with @Validated annotation in a method, validation is not working. If I remove BindingResult from the method parameters, it works fine. I used @ControllerAdvice. Any idea...
Yeung asked 17/3, 2017 at 8:45

3

Solved

I have this field declared in a model class: @Size(min = 2, max = 200, message = "{validation.name.size}") private String name; where validation.name.size is the path to a localized mess...
Selry asked 2/7, 2021 at 22:21

2

Solved

I have a User entity having email property annotated with @Email @Email private String email; I am using @Valid (javax.validation.Valid) annotation on my Controller class. The issue is that the ...
Merkle asked 25/5, 2018 at 18:47

3

Solved

I have a Map that I receive from a browser redirection back from a third party to my Spring Controller as below - @RequestMapping(value = "/capture", method = RequestMethod.POST, consumes = Media...
Syzran asked 14/7, 2019 at 11:0

6

Solved

I have a model class which has list of Strings. The list can either be empty or have elements in it. If it has elements, those elements can not be empty. For an example suppose I have a class calle...
Scum asked 15/9, 2016 at 6:15

4

Solved

Spring validation returns long error message instead of the customized once. This is the section of code in the dto. public class RequestDto implements Serializable { @NotNull(message="{id.requi...
Howard asked 7/6, 2018 at 9:12

2

Solved

I have RestController annotated with @Validated for validating path variables / request parmas: @RestController @Validated public class MainController implements ApplicationListener<Application...
Canonize asked 13/3, 2019 at 7:54

2

Solved

I’m trying to validate a POST request using Spring Validator. This is the Object I’m trying to validate: @Validated public class Request implements Serializable { private static final long serial...
Nonchalance asked 31/7, 2018 at 2:57

0

I'm using spring-boot-starter-parent version 2.4.4. I'm experimenting with validation on Typed Configuration using @ConstructorBinding and without. Here's a Typed Config that gets validated and cor...
Triplicity asked 22/3, 2021 at 8:45

1

I'm checking spring-validation Errors(BindingResult) interface. It mentions global errors in contrast with field erros. What are global errors?
Danie asked 2/1, 2017 at 14:1

3

Solved

I have a Spring Boot application using javax.validation annotations and I'm trying to return friendly JSON error messages pointing to the offending field, yet converting from the available "Ja...
Turbid asked 4/8, 2020 at 13:57

2

Solved

I'm creating a Spring-Boot microservice REST API that expects @RequestParam of type List<String>. How can I validate that the list contains a minimum and a maximum amount of values? So far I...
Decarburize asked 27/3, 2019 at 7:50

2

I am using spring boot to run an API. I want to validate the user request parameters before deserialization to prevent jackson from throwing deserialization exceptions. My thinking is it's better t...
Vachil asked 31/8, 2017 at 10:45

2

I used to validate my beans inside my spring @RestController like: @PostMapping("/documents") @ResponseStatus(HttpStatus.CREATED) fun create(@Valid @RequestBody document: DocumentCreate) { return...

1

Solved

I am trying to implement a custom password match validation in spring boot. But I am getting an error as follows:- PasswordMatch contains Constraint annotation, but does not contain a message par...
Johan asked 16/9, 2018 at 9:13

4

Solved

public ModelAndView Details(@ModelAttribute("") @Validated App app, BindingResult result, @RequestParam(value="paramSessionAttr", required=false) String sessionAttr, @RequestParam("paramAction") @...

2

Solved

I am using spring to validate a form. The model for the form is similar to this: public class FormModel { @NotBlank private String name; @NotNull @ImageSizeConstraint private MultipartFile ...
Cadaverous asked 2/10, 2017 at 11:23

1

Solved

We are evaluating Spring 5 for a project, and not sure how best to validate Mono parameters. Traditionally we had been using MethodValidationPostProcessor to validate our method parameters as below...
Quantifier asked 12/11, 2017 at 2:9

1

Solved

If we define a class level validation annotation, such as one which compare fields and have a ConstraintValidator like this: public class ComparisonValidator implements ConstraintValidator<Valu...
Atrabilious asked 26/10, 2017 at 15:6

2

Solved

I'm using Spring Boot 1.5.7, Spring JPA, Hibernate validation, Spring Data REST, Spring HATEOAS. I've a simple bean like this: @Entity public class Person { @Id @GeneratedValue private Long id...
Stuffy asked 20/10, 2017 at 14:4

1

I created a small example project to show two problems I'm experiencing in the configuration of Spring Boot validation and its integration with Hibernate. I already tried other replies I found abou...
Walburga asked 5/10, 2017 at 21:0

© 2022 - 2025 — McMap. All rights reserved.