Hi community,
I need assistance with patching a role using the Python SDK.
Below is my code showing how I have created JsonPatchOperation.
## Approach 1
approvers = [
ArrayInner(approver_type="GOVERNANCE_GROUP", approver_id="redacted"),
ArrayInner(approver_type="MANAGER", approver_id=""),
]
json_patch_operations = [
JsonPatchOperation(
op="replace",
path="/accessRequestConfig/approvalSchemes",
value=UpdateMultiHostSourcesRequestInnerValue(approvers)
)
]
## Approach 2
json_patch_operations = [
JsonPatchOperation.from_dict({
"op": "replace",
"path": "/accessRequestConfig/approvalSchemes",
"value": [
{
"approverType": "GOVERNANCE_GROUP",
"approverId": "redacted"
},
{
"approverType": "MANAGER",
"approverId": None
}
]
})
]
try:
with sailpoint.v2025.ApiClient(configuration) as api_client:
roles_api = sailpoint.v2025.RolesApi(api_client)
roles_api.patch_role(id=access.id, json_patch_operation=json_patch_operations)
except Exception as e:
print(f"Error updating access '{access.id}': {e}")
Both approach 1 and approach 2 are returning the same exception, “‘NoneType’ object has no attribute ‘items’. ‘The role is currently enabled and requestable with the approvalSchemes currently null.
Can anyone please suggest a resolution to this or a different way of changing the approval schemes.
Regards,
Bhekamandlenkosi