4 ms·
Does this corner case really justify dealing with another entire verb? Even if we stipulate that null has a specific meaning for our application that we don't w
by jessaustin 13y ago
Does this corner case really justify dealing with another entire verb? Even if we stipulate that null has a specific meaning for our application that we don't want to screw up, how about empty object, array, or string? ( {}, [], or "" ) Do all of those mean something for, e.g., the "lastname" field?
- johns 13y agoIt's not the only reason. PUT is the only way to do retryable creates since it's idempotent. Leaving it out is a huge omission.
- gruntmaster9000 13y agoPUT is almost functionally identical to a PATCH, so it’s not exactly an entire other verb. It’s also a very standard verb. Using the example from a pull request on Eve ( https://github.com/nicolaiarocci/eve/issues/96 https://github.com/nicolaiarocci/eve/issues/96 ), what if you want to indicate that the middle name is no longer known? Marking it as null means there isn’t one, not that it is unknown. Sure, for many applications the distinction doesn’t matter. But for plenty, it does. (I just recently had to fix an API’s implementation of PUT that actually was more like a PATCH but needed to be a proper PUT.) And it’s foolish for an API to require knowing a nonstandard way of expressing `undefined` when simply not defining something is the best way to not define it. Eve looks nice, but they really need to justify not supporting PUT, beyond just “PATCH is usually better”.