ActionsManager.updateTriggerBindings works not as documented
Describe the problem
When using the ActionsManager for update trigger bindings as documented, it always throws this error:
{"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Data does not match any schemas from 'oneOf'' on property bindings[0].","errorCode":"invalid_body"}
`
The Payload followed the structure as documented in the example:
var data = { bindings: [{ id_type: "action_id", id_value: ACTION_ID1},{id_type: "action_name", id_value: ACTION_NAME2}]};


What was the expected behavior?
The trigger bindings should be updated accordingly. Alternatively / Additionally a more clear error message would be helpful.
Reproduction
Use the ActionsManager as documented in the example. https://auth0.github.io/node-auth0/ActionsManager.html#updateTriggerBindings
var data = { bindings: [{ id_type: "action_id", id_value: ACTION_ID1},{id_type: "action_name", id_value: ACTION_NAME2}];
var params = { trigger_id: TRIGGER_ID };
// Using auth0 instance.
management.actions.updateTriggerBindings(params, data, function (err, bindings) {
if (err) {
// Handle error.
}
console.log(bindings.length); // 2
});
Environment
node v16.15.1 node-auth0 v2.42.0
Hi @ykmg
Looking at https://auth0.com/docs/api/management/v2#!/Actions/patch_bindings
Could you try:
var data = {
"bindings": [
{
"ref": {
"type": "action_id",
"value": ACTION_ID1
}
},
{
"ref": {
"type": "action_name",
"value": ACTION_NAME2
}
}
]
}
If it works I'll update the docs.
Closing due to inactivity, ping me if you want to reopen