{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/1087","repository_url":"https://api.github.com/repos/eclipse/smarthome","labels_url":"https://api.github.com/repos/eclipse/smarthome/issues/1087/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/smarthome/issues/1087/comments","events_url":"https://api.github.com/repos/eclipse/smarthome/issues/1087/events","html_url":"https://github.com/eclipse/smarthome/pull/1087","id":135839433,"number":1087,"title":"Enhance ThingResource in order to create Things with the dynamically provided Channels","user":{"login":"teichsta","id":2108636,"avatar_url":"https://avatars.githubusercontent.com/u/2108636?v=3","gravatar_id":"","url":"https://api.github.com/users/teichsta","html_url":"https://github.com/teichsta","followers_url":"https://api.github.com/users/teichsta/followers","following_url":"https://api.github.com/users/teichsta/following{/other_user}","gists_url":"https://api.github.com/users/teichsta/gists{/gist_id}","starred_url":"https://api.github.com/users/teichsta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teichsta/subscriptions","organizations_url":"https://api.github.com/users/teichsta/orgs","repos_url":"https://api.github.com/users/teichsta/repos","events_url":"https://api.github.com/users/teichsta/events{/privacy}","received_events_url":"https://api.github.com/users/teichsta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-23T19:33:57Z","updated_at":"2016-02-25T15:36:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eclipse/smarthome/pulls/1087","html_url":"https://github.com/eclipse/smarthome/pull/1087","diff_url":"https://github.com/eclipse/smarthome/pull/1087.diff","patch_url":"https://github.com/eclipse/smarthome/pull/1087.patch"},"body":"While creating Things (through REST) their Channels are adding according to the given `channel-configuration` of their ESH-INF/configuration files. This PR add the possibility to provide the channels to be created over REST.\r\n\r\nThis add the possibility to create Things with variable amount of channels."},"comment":{"url":"https://api.github.com/repos/eclipse/smarthome/issues/comments/188844414","html_url":"https://github.com/eclipse/smarthome/pull/1087#issuecomment-188844414","issue_url":"https://api.github.com/repos/eclipse/smarthome/issues/1087","id":188844414,"user":{"login":"kaikreuzer","id":3244965,"avatar_url":"https://avatars.githubusercontent.com/u/3244965?v=3","gravatar_id":"","url":"https://api.github.com/users/kaikreuzer","html_url":"https://github.com/kaikreuzer","followers_url":"https://api.github.com/users/kaikreuzer/followers","following_url":"https://api.github.com/users/kaikreuzer/following{/other_user}","gists_url":"https://api.github.com/users/kaikreuzer/gists{/gist_id}","starred_url":"https://api.github.com/users/kaikreuzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaikreuzer/subscriptions","organizations_url":"https://api.github.com/users/kaikreuzer/orgs","repos_url":"https://api.github.com/users/kaikreuzer/repos","events_url":"https://api.github.com/users/kaikreuzer/events{/privacy}","received_events_url":"https://api.github.com/users/kaikreuzer/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T15:36:14Z","updated_at":"2016-02-25T15:36:14Z","body":"Looking a bit closer at the (existing, old) code, I feel that the `ThingResource.create` might need to be completely revisited. Besides swallowing the channels, it does the same with properties, doesn't it?\r\nSo I would suggest, that the ThingDTOMapper gets enhanced to also map ThingDTOs to Things and that this is then called by the create method and the result is fed into the ThingRegistry (not the ManagedThingProvider anymore!)\r\nThe very same would have to be done in the `ThingResource.update` method, as this swallows all newly added (or removed!) channels and properties as well."}}