Spring Rest API Validation

https://jcp.org/en/jsr/detail?id=303

 @NotBlank(message = "username can't empty!")
    String username;


 @NotBlank
    @Size(min = 3, max = 50)
    private String username;

@NotEmpty
    @Length(max = 140)
    private String text;


ConstraintCompositionBoolean operator that is applied to all constraints of a composing constraint annotation.
CreditCardNumberThe annotated element has to represent a valid credit card number.
CreditCardNumber.ListDefines several @CreditCardNumber annotations on the same element.
EmailThe string has to be a well-formed email address.
Email.ListDefines several @Email annotations on the same element.
LengthValidate that the string is between min and max included.
Length.ListDefines several @Length annotations on the same element.
NotBlankValidate that the annotated string is not null or empty.
NotBlank.ListDefines several @NotBlank annotations on the same element.
NotEmptyAsserts that the annotated string, collection, map or array is not null or empty.
NotEmpty.ListDefines several @NotEmpty annotations on the same element.
RangeThe annotated element has to be in the appropriate range.
Range.ListDefines several @Range annotations on the same element.
SafeHtmlValidate a rich text value provided by the user to ensure that it contains no malicious code, such as embedded

Comments

Popular posts from this blog

அவன் ஏன் கூலியானான்?

படையப்பாவும் ஹெர்குலசும்

தட்டு வண்டியில் காளிக்கோயில் - சிறுகதை