Last active
December 23, 2020 14:08
-
-
Save rzymek/9ce09c67fb9edbada0f02468689cc63a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.swagger.annotations.ApiModelProperty; | |
import javax.validation.constraints.NotNull; | |
@RestController | |
@RequestMapping("/users") | |
class UserResource { | |
@GetMapping() | |
List<User> allUsers() { /* ... */ } | |
static class User { | |
@NotNull | |
public String email; | |
public String firstName; | |
@ApiModelProperty(notes = "User's surname") | |
public String lastName; | |
@NotNull | |
public EnumSet<Role> roles; | |
} | |
enum Role { | |
USER, ADMIN | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment