spring-boot-security-login
spring-boot-security-login copied to clipboard
Signup POST role must be an Array
This is not a bug, just a slight oversight in the directions and perhaps some naivety on my part. The image merely implies posting the required parameters appearing to be {username, email, role, password} I was seeing the error
JSON parse error: Cannot construct instance of `java.util.HashSet` . . . to deserialize from String value ('ROLE_ADMIN')<EOL>
Then it occurred to me surely a user can have all the roles so it must require an array
// My mistake "role" : "ROLE_ADMIN"
{
"username": "greg",
"email": "[email protected]",
"role": ["ROLE_ADMIN"],
"password": "4bangads"
}
I am only posting in case anyone else sees the issue. Thank your for this great example and your time on this!