Updated specs

This commit is contained in:
Joshua Sangmeister 2020-11-13 16:18:34 +01:00
parent c811926478
commit 8cd6e02772
1 changed files with 18 additions and 8 deletions

View File

@ -84,14 +84,24 @@ Interface CreateEvent {
} }
} }
// Note: For deleting keys, they must be set to `None`. These keys will be removed from /**
// the model. * Note: For deleting keys, they must be set to `None`. These keys will be removed from
// list_fields can be used to partially update list fields: the values in `add` will be * the model.
// appended to the given field, the values in `remove` will be removed from the field. * list_fields can be used to partially update list fields: the values in `add` will be
// The case of double adding or removing something invalid will be silently ignored. * appended to the given field, the values in `remove` will be removed from the field.
// All given list_fields must be flat arrays of strings or ints, else an error is * Either fields or list_fields must be given or an error will be thrown.
// thrown. * An exception will be thrown if:
// Either fields or list_fields must be given or an error will be thrown. * - a field in list_fields is not empty and not a list
* - a field in list_fields contains other entries than strings or ints
* Other edge cases:
* - an element should be added that is already in the list: this element is ignored,
* other potentially given elements are still added as normal
* - an element should be removed that is not in the list: this element is ignored,
* other potentially given elements are still removed as normal
* - the field does not yet exist on the model:
* - add: same function as if the value was given in `fields`
* - remove: nothing happens
*/
Interface UpdateEvent { Interface UpdateEvent {
type: 'update'; type: 'update';
fqid: Fqid; fqid: Fqid;