Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-948

Switch to disable PUT for creation on item resources by default

    Details

    • Sprint:
      Lovelace M2 / M3

      Description

      PUT /{resource}/{id} ends up creating a new resource if it doesn't exist. According to the doc for the item resource, the behavior should be as follows:

      Replaces the state of the target resource with the supplied request body.

      Thus for a non-existent id, I'd expect a HTTP status 404, not a new resource (you can't "replace" something that doesn't exist). I do not expect the user to call my API with a given id to use for a new resource, because the id almost always is internal implementation specific (like an auto-increment key in the DB). Note that POST /{resource} behavior is to create a new item resource and add it to the collection.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olivergierke Oliver Gierke
                Reporter:
                asarkar Abhijit Sarkar
                Last updater:
                Predrag
              • Votes:
                3 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: