{"action":"created","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-go/issues/424","labels_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/424/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/424/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/424/events","html_url":"https://github.com/aws/aws-sdk-go/issues/424","id":115449929,"number":424,"title":"how to use json unmarshal Resolve Type json. RawMessage ","user":{"login":"upccup","id":13341880,"avatar_url":"https://avatars.githubusercontent.com/u/13341880?v=3","gravatar_id":"","url":"https://api.github.com/users/upccup","html_url":"https://github.com/upccup","followers_url":"https://api.github.com/users/upccup/followers","following_url":"https://api.github.com/users/upccup/following{/other_user}","gists_url":"https://api.github.com/users/upccup/gists{/gist_id}","starred_url":"https://api.github.com/users/upccup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upccup/subscriptions","organizations_url":"https://api.github.com/users/upccup/orgs","repos_url":"https://api.github.com/users/upccup/repos","events_url":"https://api.github.com/users/upccup/events{/privacy}","received_events_url":"https://api.github.com/users/upccup/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aws/aws-sdk-go/labels/feedback%20requested","name":"feedback requested","color":"d4c5f9"},{"url":"https://api.github.com/repos/aws/aws-sdk-go/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-06T06:59:58Z","updated_at":"2015-11-08T02:14:18Z","closed_at":null,"body":"i use *jsonutil.UnmarshalJSON* to Unmarshal\r\n```\r\n{\r\n    \"type\":\"TaskAgent\",\r\n    \"message\":{\r\n        \"action\":\"update\",\r\n        \"params\":{\r\n            \"fileUrl\":\"http://xxxxx.net/test/aaa.deb\",\r\n            \"version\":\"v1107111\",\r\n            \"instructions\":\"\"\r\n        },\r\n        \"timestamp\":1443492224.378818,\r\n        \"attach\":\"\"\r\n    }\r\n}\r\n```\r\nto type \r\n```\r\ntype TaskAgent struct {\r\n\tAction    *string    `locationName:\"action\" type:\"string\"`\r\n\tParams    *json. RawMessage    `locationName:\"params\" type:\"structure\"`\r\n\tTimestamp *time.Time `locationName:\"timestamp\" type:\"timestamp\" timestampFormat:\"unix\"`\r\n\tAttach    *string    `locationName:\"attach\" type:\"string\"`\r\n}\r\n```\r\n\r\nthere has a error\r\n```\r\n[Error] Unable to handle message from backend err: unsupported JSON value (map[version:v1107111 instructions: fileUrl:http://xxxxx.net/test/aaa.deb])\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/aws/aws-sdk-go/issues/comments/154770760","html_url":"https://github.com/aws/aws-sdk-go/issues/424#issuecomment-154770760","issue_url":"https://api.github.com/repos/aws/aws-sdk-go/issues/424","id":154770760,"user":{"login":"upccup","id":13341880,"avatar_url":"https://avatars.githubusercontent.com/u/13341880?v=3","gravatar_id":"","url":"https://api.github.com/users/upccup","html_url":"https://github.com/upccup","followers_url":"https://api.github.com/users/upccup/followers","following_url":"https://api.github.com/users/upccup/following{/other_user}","gists_url":"https://api.github.com/users/upccup/gists{/gist_id}","starred_url":"https://api.github.com/users/upccup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/upccup/subscriptions","organizations_url":"https://api.github.com/users/upccup/orgs","repos_url":"https://api.github.com/users/upccup/repos","events_url":"https://api.github.com/users/upccup/events{/privacy}","received_events_url":"https://api.github.com/users/upccup/received_events","type":"User","site_admin":false},"created_at":"2015-11-08T02:14:18Z","updated_at":"2015-11-08T02:14:18Z","body":"hi @jasdel Thank you for your answer. But I think it does not solve my problem.  I use  jsonutil.UnmarshalJSON to automatically parse message when a message is received. so i do not want to use 'switch' and just add the type to a type list like https://github.com/aws/amazon-ecs-agent/blob/master/agent/acs/client/acs_client_types.go#L32.  I want to know whether I can do.\r\nThanks."}}