-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
../assets/{asset_id}/ PUT: clarify that new asset is created #2019
Conversation
"Update" implies inplace operations which is not the case here: if metadata is different, we get a new asset returned, hence there is really no "update" to an existing asset, but rather CoW style of operation on an asset upon change.
Thanks, @yarikoptic. I'm against this change, for two reasons:
Basically, I would like to keep the existing docstrings because they cause less confusion, and because I have a vision for how to simplify our "update" operation. If you're ok with this reasoning, I can close the PR. |
;-) are you sure about "always" and what was the intention? COW operation is what was intended in our design and was implemented. Documentation here is simply factually wrong since metadata of an existing asset with the original asset_id is not updated! It is not just a matter of intents, but rather description of what it does and an effect of the operation. As a result it is actually misleading user.
it may or may not -- yet to be checked and also redesigned/reimplemented, and docstrings to be adjusted accordingly. Not a factor IMHO for documentation describing current behavior. |
Since we implemented this behavior under the
Let's have the discussion about this. If there is no longer a need for CoW (which I believe is the case) then keeping it around only has disadvantages without any upside. If we conclude that this is the case, we should modify how the API works. For the moment, you've convinced me that we should update these docstrings. We'll just have to update them back if we do change the API's behavior to be more consistent with the RESTful concept of a PUT. |
🚀 PR was released in |
"Update" (or "change", both words are used, see blow) IMHO implies in-place operations which is not the case here: if metadata is different, we get a new asset returned, hence there is really no "update" to an existing asset, but rather CoW style of operation on an asset upon change.
To be frank: there is a notion of "update" as the new created asset is assigned to the same dandiset, hence it is replacing previous asset present in the dandiset. But as we are talking about a new asset object with new asset id, I think it is important to get the only visible API documentation "straight".
(update|change)_asset
into e.g.create_updated_asset
(since not always creates one). ATM we haveWDYT @waxlamp @jjnesbitt ?