spring-boot-security-login icon indicating copy to clipboard operation
spring-boot-security-login copied to clipboard

Signup POST role must be an Array

Open gregbown opened this issue 2 years ago • 0 comments

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!

gregbown avatar Mar 24 '22 16:03 gregbown