The updateById() function inside system.models.[your_model].updateById() supports partial schemas and patch updates.
To create the appropriate schemas, use either:
The first one turns all fields optional, and the second one does the same and then adds a required id field in the end. For your endpoint use withIdPartial:
{
method: 'PUT',
path: `/my-model/:id`,
inputSchema: Schema.withIdPartial(schema),
outputSchema: Schema.withInstance(schema),
isLoggedIn: true,
run: async (system, { id, ...rest}) => {
return await system.models.myModel.updateById(id, rest);
}
}