openlibraryenvironment/gokb

General about POST/PATCH/PUT

Closed this issue · 3 comments

I've requested - badly - to wrap the data for POST, PATCH or PUT in an additional object like this:

{
  data: ...
}

but that is not needed, because we will never have other fields outside this data entry and by the way the other REST protocols hanging around don't do also. So we could change to plain objects in these circumstances. Opinions?

i have no preference for one or the other. Just to keep it uniform troughout the application. Therefore, putting the data in a box named data on the way in and out the rest engine seems to be a reasonable solution with minimal effort.

I have a preference to remove the indirection because it gives no additional benefit and does not fit into the other REST APIs.

So I suggest to remove it - less to type, check, code ....

My personal preference would be to find the semantics of data reflected in their textual representation. Since those few additional letters are too much of a burden to type, check and code, especially for all the other APIs, we agree on leaving them out.