Skip to content

Instantly share code, notes, and snippets.

@rubykv
Last active June 21, 2021 11:23
Show Gist options
  • Save rubykv/6255d94f08a5f78a0140856dfba0f2b5 to your computer and use it in GitHub Desktop.
Save rubykv/6255d94f08a5f78a0140856dfba0f2b5 to your computer and use it in GitHub Desktop.
@validated Example
public class Order {
@NotBlank(groups = {ValidationCheckOrder.class})
private String orderId;
@Email(groups = {ValidationCheckEmail.class})
@NotBlank(groups = {ValidationCheckEmail.class})
private String email;
}
@PostMapping(value = "/order")
public String stepOne(@Validated(Order.ValidationCheckOrder.class) Order order) {...}
@PostMapping(value = "/email")
public String stepTwo(@Validated(Order.ValidationCheckEmail.class) Order order) {...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment