I see there are already threads about using simple arrays as parameters, but I can’t seem to get the syntax right for an array of objects. Here is an example of what I am trying to do:
{
name: 'UpdateRoles',
description:
'This function updates the roles of users. It accepts an array of objects. Each object should include a role name, an email address, and an action that specifies whether the role should be added or removed.',
parameters: {
type: 'array',
items: {
type: 'object',
properties: {
rolename: {
type: 'string',
enum: ['role1','role2','admin']
description: 'The name of the role to be updated.',
},
email: {
type: 'string',
description:
'The email address of the user whose role is being updated.',
},
action: {
type: 'string',
enum: ['add', 'remove'],
description:
"The action to be performed. 'add' to assign the role to the user, 'remove' to remove the role from the user.",
},
},
required: ['rolename', 'email', 'action'],
},
},
};
This version appears to be the most JSON-schema compliant, however I have tried many different variants. Still receiving a 400 Bad Request error every time. Can only get it to work with the most simple of function calls. Any help would be greatly appreciated.