Currently the controller that is generated by web mvc all does not contain a working updateFromJson method. The id argument is never applied to the deserialised entity so that the attempted merge() ends up in a create instead of an update.
Steps to reproduce:
- Run the attached roo script to create a simple REST webapp.
- Start the webapp.
- Create a new Word with a POST to the webapp.
- Request the word list to make sure the new word was persisted.
- Attempt to update the word with a PUT request with the resources ID.
- Request the word list again to see if the word with ID 1 was updated.
As can be seen a new entry is created instead of the word being updated. A seccond attempt at the PUT will result in a unique constraint violation.