SOCSSabaragamuwa / testrepo

0 stars 0 forks source link

Add beans property role to User #6

Open SOCSSabaragamuwa opened 6 years ago

SOCSSabaragamuwa commented 6 years ago

There are three types of roles: user, admin and moderator. If the role is not set, it should default to user.

POST /users Request schema 1

{
    “email”: “user@gmail.com”
}

Response schema 1 Status 201: Return if the user was successfully created.

{
    “self”: “http://localhost:8090/api/users/{user_id}”,
    “email”: “user@gmail.com”,
    "role": "user"
}

Request schema 2

{
    “email”: “moderator@letmehack.lk”,
    "role": "moderator"
}

Response schema 2

{
    “self”: “http://localhost:8090/api/users/{user_id}”,
    “email”: “moderator@letmehack.lk”,
    "role": "moderator"
}

Status 400 Return if the input is invalid (e.g. invalid role name).

Note