valid not working spring boot when method is called from same class
问题 My car model with bean validation @Document(collection = "Cars") public class Car { public static final String NAME = "car"; @Id private String id; @NotBlank(message = "Brand name should n't be empty") @CsvBindByName(column = "Car Brand") private String brand; @NotBlank(message = "Model name should n't be empty") @CsvBindByName(column = "Car Model") private String model; } Car service @Service @Validated public class CarServices { @Autowired CarRepo repo; public Car addCar(@Valid Car car,