日常异常记录:1
接口请求参数中,BigDecimal 类型参数,使用了@NotBlank校验,改用@NotNull校验。
结论:
@NotEmpty 用在集合类参数,加了@NotEmpty的String、Collection、Map、数组类型参数,要求参数不能为null且size()>0
@NotBlank:只用于String类型参数校验,要求参数不能为null且trim()之后size>0
@NotNull: 参数不能为null,但可以为empty,不做length约束
接口请求参数中,BigDecimal 类型参数,使用了@NotBlank校验,改用@NotNull校验。
@NotEmpty 用在集合类参数,加了@NotEmpty的String、Collection、Map、数组类型参数,要求参数不能为null且size()>0
@NotBlank:只用于String类型参数校验,要求参数不能为null且trim()之后size>0
@NotNull: 参数不能为null,但可以为empty,不做length约束