I am getting below error message for Invoke-RestMethod with PATCH method type
Invoke-RestMethod : {"detail":"Received JSON for the roles attribute does not match expected
format.","error":400,"errorCode":"INVALID_JSON_ATTRIBUTE","parameters":["roles"],"reason":"Bad Request"}
Can some one let me know the mistake with below code please?
if ($atlasdbname -contains $dbname)
{
$dbnew = @{
roles = $rolnew}
$dbupdate = $dbnew | ConvertTo-Json
Invoke-RestMethod -Method PATCH -Uri $prjuri -Headers @{Authorization = "Basic $base64AuthInfo"} -ContentType "application/json" -Credential $credential -Body $dbupdate
Thanks