{"action":"created","issue":{"url":"https://api.github.com/repos/rails/rails/issues/27162","repository_url":"https://api.github.com/repos/rails/rails","labels_url":"https://api.github.com/repos/rails/rails/issues/27162/labels{/name}","comments_url":"https://api.github.com/repos/rails/rails/issues/27162/comments","events_url":"https://api.github.com/repos/rails/rails/issues/27162/events","html_url":"https://github.com/rails/rails/issues/27162","id":191410946,"number":27162,"title":"Explain detail of websocket behavior in documentation","user":{"login":"brunomacabeusbr","id":9501115,"avatar_url":"https://avatars.githubusercontent.com/u/9501115?v=3","gravatar_id":"","url":"https://api.github.com/users/brunomacabeusbr","html_url":"https://github.com/brunomacabeusbr","followers_url":"https://api.github.com/users/brunomacabeusbr/followers","following_url":"https://api.github.com/users/brunomacabeusbr/following{/other_user}","gists_url":"https://api.github.com/users/brunomacabeusbr/gists{/gist_id}","starred_url":"https://api.github.com/users/brunomacabeusbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunomacabeusbr/subscriptions","organizations_url":"https://api.github.com/users/brunomacabeusbr/orgs","repos_url":"https://api.github.com/users/brunomacabeusbr/repos","events_url":"https://api.github.com/users/brunomacabeusbr/events{/privacy}","received_events_url":"https://api.github.com/users/brunomacabeusbr/received_events","type":"User","site_admin":false},"labels":[{"id":300028327,"url":"https://api.github.com/repos/rails/rails/labels/actioncable","name":"actioncable","color":"bfdadc","default":false},{"id":150377,"url":"https://api.github.com/repos/rails/rails/labels/docs","name":"docs","color":"02d7e1","default":false},{"id":257468118,"url":"https://api.github.com/repos/rails/rails/labels/needs%20work","name":"needs work","color":"000000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-24T00:53:38Z","updated_at":"2016-12-13T02:35:48Z","closed_at":null,"body":"A lot of people uses Rails to create a provider API. In some cases, we need to establish a websocket connection. But, this situation wasn't written in the documentation, and [it's was a problem for me](https://stackoverflow.com/questions/40749647/not-receive-broadcast/40776406).\r\n\r\nAfter establishing the connection on websocket's url, I need to send a message to the channel that I want to subscribe, like `{\"command\":\"subscribe\",\"identifier\":\"{\\\"channel\\\":\\\"MessagesChannel\\\"}\"}`.\r\n\r\nIn my opinion, it is good write this detail [in this article](http://edgeguides.rubyonrails.org/action_cable_overview.html)"},"comment":{"url":"https://api.github.com/repos/rails/rails/issues/comments/266618729","html_url":"https://github.com/rails/rails/issues/27162#issuecomment-266618729","issue_url":"https://api.github.com/repos/rails/rails/issues/27162","id":266618729,"user":{"login":"brunomacabeusbr","id":9501115,"avatar_url":"https://avatars.githubusercontent.com/u/9501115?v=3","gravatar_id":"","url":"https://api.github.com/users/brunomacabeusbr","html_url":"https://github.com/brunomacabeusbr","followers_url":"https://api.github.com/users/brunomacabeusbr/followers","following_url":"https://api.github.com/users/brunomacabeusbr/following{/other_user}","gists_url":"https://api.github.com/users/brunomacabeusbr/gists{/gist_id}","starred_url":"https://api.github.com/users/brunomacabeusbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunomacabeusbr/subscriptions","organizations_url":"https://api.github.com/users/brunomacabeusbr/orgs","repos_url":"https://api.github.com/users/brunomacabeusbr/repos","events_url":"https://api.github.com/users/brunomacabeusbr/events{/privacy}","received_events_url":"https://api.github.com/users/brunomacabeusbr/received_events","type":"User","site_admin":false},"created_at":"2016-12-13T02:35:48Z","updated_at":"2016-12-13T02:35:48Z","body":"Well... I'm writing a code in Swift to use Rails' websocket more easily. And, I can't understand why values of key \"identifier\" and \"data\" to pass as string, instead of dictionary!\r\n\r\nI expected:\r\n```\r\n{\r\n  \"command\": \"message\",\r\n  \"identifier\": {\r\n    \"channel\": \"MessagesChannel\r\n  },\r\n  \"data\": {\r\n    \"room_id\": \"1\",\r\n    \"action\": \"enter_room\"\r\n  }\r\n}\r\n```\r\n\r\nBut, I need use:\r\n```\r\n{\r\n  \"command\": \"message\",\r\n  \"identifier\": \\\"{\r\n    \\\"channel\\\": \\\"MessagesChannel\\\"\r\n  }\",\r\n  \"data\": \"{\r\n  \\\"room_id\\\": \\\"1\\\",\r\n  \\\"action\\\": \\\"enter_room\\\"\r\n  }\"\r\n}\r\n```\r\n\r\nIt took me a lot of time to find it. Why we need use a string?"}}
{"actor":{"display_login":"brunomacabeusbr"}}