1. Controller layer
@ApiOperation(value = "port")
@PostMapping("/ygbx/regular")
public Long regular(@Validated @RequestBody OrderCheckRegularVO vo) {
return orderCheckService.saveRegular(vo);
}
2. Main Vo
Solution: add @valid to the VO declaration inside the main vo
@Data
@ApiModel(description = "VO")
public class OrderCheckRegularVO extends OrderCheckBaseVO {
@NotNull
@Valid
private ProductYgbxRegularVO price;
@NotNull
@Valid
private OrderCheckRegularPolicyInfoVO policyInfo;
@NotNull
@Valid
private OrderCheckChargeInfoVO chargeInfo;
@NotNull
@Valid
private OrderCheckBenefitTotalVO benefitInfo;
@NotEmpty
@Valid
private List<OrderCheckKindVO> kindList;
}
Read More:
- I/O error while reading input message; nested exception is java.io.IOException: Stream closed
- nested exception is java.lang.StackOverflowError [How to Solve]
- Request processing failed; nested exception is java.lang.NullPointerException or UnsatisfiedDependencyE
- [Solved] Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:
- [Solved] Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullPointerEx
- [Solved] nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
- [Solved] Failed to start bean ‘eurekaAutoServiceRegistration‘; nested exception is java.lang.NullPointerExce
- [Solved] Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NullPointerException
- [Solved] MultipartException: Failed to parse multipart servlet request; nested exception is java.lang.Runtime
- [Solved] swagger Failed to start bean ‘documentationPluginsBootstrapper‘; nested exception is java.lang.NullP
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- [Solved] nacos Startup Error: nested exception is java.lang.RuntimeException: java.lang.RuntimeException: [db-load-error
- [Solved] Configuration Error: deployment source ‘xxx:war‘ is not valid
- Mongodb java version 3.X, prompt “XXX (an encryption algorithm) is not available” when there is a user name and password
- [Solved] JSON parse error: Cannot deserialize instance of `java.util.ArrayList<..> out of START_OBJECT token;
- [Solved] org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is
- [Solved] nested exception is org.apache.ibatis.builder.BuilderException: Error invoking SqlProvider method
- [Solved] nested exception is org.flowable.common.engine.api.FlowableException: Error initialising dmn data mo
- [Solved] Upload Files Error: Request processing failed;nested exception is org.springframework.web.multipart.MultipartExcepti
- Flink Error: is not serializable. The object probably contains or references non serializable fields.