swistakm/graceful

Add bulk create/update support using PATCH (or PUT)

swistakm opened this issue · 0 comments

It is very useful feature to allow bulk creation and/or update of objects represented by resources. Initial idea is to add PATCH handler to ListCreateAPI class. Maybe also CreateMixin should be modified to allow bulk creation.

The rationale behind using PATCH is that this method is used to partially modify resource. List resources represent collections of objects, so passing a list of new representations to such resource may be considered as intention to add/modify them within existing collection.

The PUT method could be understood as intention to replace whole collection in list resource. Usefulness of that is questionable but it may be explored in future.

The important thing that needs to be discussed is the question if we should separate the bulk creation from bulk update or leave that to the user. In my opinion default "upsert-like" behaviour is more flexible. Developer may easily decide how to handle his case when writing his storage integration code. Anyway this should be decided before implementing because this will affect API naming and documentation.