We recently modified the validation logic to allow for keyless PUT/PATCH in the case that the keys which are missing are auto-generated, and this has introduced some code duplication between the upsert and insert operations which can be factored out.