Skip to main content

Timeline for answer to POST / PUT with no explicit id in request by Ewan

Current License: CC BY-SA 4.0

Post Revisions

5 events
when toggle format what by license comment
Jun 4, 2025 at 10:27 comment added Ewan I think i would separate the create and update endpoints in either case as I would expect different business logic to be applied
Jun 4, 2025 at 10:25 comment added Ewan it branches off into another topic ie. "should the object have an id before its persisted?" I think the general agreement is that it should, and so you use guids and have the client set the id, which means you can always include it. If you let the sever create the id, then sure, you can leave it null and return it, or have a CreateObjectRequest object with different properties or whatever
Jun 4, 2025 at 9:56 comment added Ahmed Tawfik With best option, would a POST to create another user just omit the id? If so, is the risk of accidental omission of id(e.g. due to bug) resulting in creating new users rather than updating the existing one acceptable (I think so, but just wondering)?
Jun 2, 2025 at 21:31 history edited Ewan CC BY-SA 4.0
added 90 characters in body
Jun 2, 2025 at 21:22 history answered Ewan CC BY-SA 4.0