xregistry / spec

xRegistry related specifications
https://xRegistry.io
Apache License 2.0
35 stars 6 forks source link

Support for replacement of an entire collection? #130

Closed duglin closed 3 months ago

duglin commented 4 months ago

Today, there's no way to replace an entire collection in one atomic operation. The user would need to do a delete() followed by a post() to the collection as a 2 step process. @jskeet was wondering if this it too restrictive or if it might cause pain for clients?

Today using a PUT on a collection results in an error, if we did want to support a "replace" type of operation then we could use PUT to do it.

duglin commented 3 months ago

We decided awhile ago that an auto-delete of a collection is such a large (and scary) operation that we wanted an explicit "yes delete the collection" from the user to make sure that it's really what they wanted. It's a bit too easy for a newbie to use PUT instead of POST by mistake. So, making it a 2-step process introduces an "are you sure?" type of check.