opiproject / opi-api

Open Programmable Infrastructure API and Behavioral Model
Apache License 2.0
32 stars 41 forks source link

[storage][front-end] Delete xxxCreateResponse messages #179

Closed glimchb closed 2 years ago

glimchb commented 2 years ago

Following Google AIP-133 - Standard methods: Create

Related to #174

glimchb commented 2 years ago

Looks good.

Could this also be used to have the API provider assign the object handle, if the API user passes in a 0-length handle in the XxxCreateRequest for example ?

@llabordehpe I think so yes. AIP is talking about this here https://google.aip.dev/133#user-specified-ids and here https://google.aip.dev/155

jainvipin commented 2 years ago

LGTM - This change is inline with REST semantics where object itself is returned from a POST (aka create) request as mentioned here.

Having said the usefulness on passing the context back is desired upon failure. HTTP codes cover a full gammut of errors on the object resources as listed here, but in my experience, sometimes they are not sufficient or doesn't capture the domain specific context of an error. For now let's stick to the REST semantics and then discuss later if we must return any specific return message to handle failures better.

glimchb commented 2 years ago

got almost all the responses, merging this now