Creating attributes on roles with Java and Spring

I am trying to create Realm roles and attributes on the roles. The code below creates the roles, but the attributes are ignored. Any advice is appreciated.

private String createRole(String roleName, String rollDescription, String realm, HashMap<String, List<String>> map) throws JSONException {
	
	try {
		
		String keycloakRolesUri = "http://" + keycloakIPAddress + ":" + keycloakPort + "/auth/admin/realms/$REALM/roles";
		
		final String uri = keycloakRolesUri.replace("$REALM", realm);
		String adminToken = getAdminAccessTokenPWGrant();

		RestTemplate restTemplate = new RestTemplate();
		RoleRepresentation roleRepresentation = new RoleRepresentation();
        
        roleRepresentation.setAttributes(map);
        roleRepresentation.setClientRole(false);
		roleRepresentation.setName(roleName);
		roleRepresentation.setDescription(rollDescription);
		roleRepresentation.setComposite(false);
		
		HttpHeaders headers = new HttpHeaders();
		headers.set("Content-Type", "application/json");
		headers.set("Authorization", "Bearer " + adminToken);

		HttpEntity<RoleRepresentation> request = new HttpEntity<>(roleRepresentation, headers);
		restTemplate.postForObject(uri, request, RoleRepresentation.class);
	}
	catch(Exception e) {
		log.error(e.getMessage());
		return e.getMessage();
	}
	
	return "success";
}