{"action":"created","issue":{"url":"https://api.github.com/repos/terrestris/shogun2/issues/128","labels_url":"https://api.github.com/repos/terrestris/shogun2/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/terrestris/shogun2/issues/128/comments","events_url":"https://api.github.com/repos/terrestris/shogun2/issues/128/events","html_url":"https://github.com/terrestris/shogun2/pull/128","id":128812276,"number":128,"title":"Refactoring of the REST-Update method. [WIP]","user":{"login":"KaiVolland","id":1849416,"avatar_url":"https://avatars.githubusercontent.com/u/1849416?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiVolland","html_url":"https://github.com/KaiVolland","followers_url":"https://api.github.com/users/KaiVolland/followers","following_url":"https://api.github.com/users/KaiVolland/following{/other_user}","gists_url":"https://api.github.com/users/KaiVolland/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiVolland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiVolland/subscriptions","organizations_url":"https://api.github.com/users/KaiVolland/orgs","repos_url":"https://api.github.com/users/KaiVolland/repos","events_url":"https://api.github.com/users/KaiVolland/events{/privacy}","received_events_url":"https://api.github.com/users/KaiVolland/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-01-26T12:52:23Z","updated_at":"2016-01-28T12:50:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/terrestris/shogun2/pulls/128","html_url":"https://github.com/terrestris/shogun2/pull/128","diff_url":"https://github.com/terrestris/shogun2/pull/128.diff","patch_url":"https://github.com/terrestris/shogun2/pull/128.patch"},"body":"This PR addresses the REST-PUT interface.\r\n\r\n- [x] The PUT-Interface should be able to work with partially changes of an object.\r\n\r\nApplication sampledata 1:\r\n```js\r\n{\r\n  \"id\": 57,\r\n  \"name\": \"Peter\"\r\n}\r\n```\r\n\r\n- [ ] The interface should be able to work with nested data.\r\n\r\n The current state (e62227e) can only handle changes at the top level. Changes to childproperties e.g. the name of the viewport in an application leed to an error when data does contain an id (sampledata 2) or an empty child if data doesn't contain id (sampledata 3).\r\n\r\nApplication sampledata 2:\r\n```js\r\n{\r\n  \"id\": 57,\r\n  \"name\": \"Peter\",\r\n  \"viewport\": {\r\n    \"id:\" 56,\r\n    \"name\": \"Silke\"\r\n  }\r\n}\r\n```\r\n\r\nApplication sampledata 3:\r\n```js\r\n{\r\n  \"id\": 57,\r\n  \"name\": \"Peter\",\r\n  \"viewport\": {\r\n    \"name\": \"Silke\"\r\n  }\r\n}\r\n```\r\n\r\nIf we can solve this problems the update method would be really nice."},"comment":{"url":"https://api.github.com/repos/terrestris/shogun2/issues/comments/176165616","html_url":"https://github.com/terrestris/shogun2/pull/128#issuecomment-176165616","issue_url":"https://api.github.com/repos/terrestris/shogun2/issues/128","id":176165616,"user":{"login":"KaiVolland","id":1849416,"avatar_url":"https://avatars.githubusercontent.com/u/1849416?v=3","gravatar_id":"","url":"https://api.github.com/users/KaiVolland","html_url":"https://github.com/KaiVolland","followers_url":"https://api.github.com/users/KaiVolland/followers","following_url":"https://api.github.com/users/KaiVolland/following{/other_user}","gists_url":"https://api.github.com/users/KaiVolland/gists{/gist_id}","starred_url":"https://api.github.com/users/KaiVolland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaiVolland/subscriptions","organizations_url":"https://api.github.com/users/KaiVolland/orgs","repos_url":"https://api.github.com/users/KaiVolland/repos","events_url":"https://api.github.com/users/KaiVolland/events{/privacy}","received_events_url":"https://api.github.com/users/KaiVolland/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T12:50:23Z","updated_at":"2016-01-28T12:50:23Z","body":"> But i am not sure if we really want to allow the updating of nested objects/collections as this would (currently) only work if the nested object is annotated with @Cascade(CascadeType.SAVE_UPDATE)\r\n\r\nWe allready have this annotation on nearly every property e.g.:\r\n\r\nhttps://github.com/terrestris/shogun2/blob/master/src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/Application.java#L82-L83\r\n\r\nhttps://github.com/terrestris/shogun2/blob/master/src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/map/MapConfig.java#L70-L71\r\n\r\nI would appreciate to be able to update nested objects/collections with only one PUT request. We could add errorhandling if the annotation on an edited property is missing.\r\n\r\nThe adavantage would be the you could easily update applications from the Client side.\r\nThis might be an disadavantag too, as you could even easily send a malformed json the corrupts your whole data.\r\n\r\nWould be cool if some other devs could submit there opinion on this. @marcjansen @weskamm @dnlkoch @chrismayer "}}