{"action":"created","issue":{"url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/395","repository_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway","labels_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/395/labels{/name}","comments_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/395/comments","events_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/395/events","html_url":"https://github.com/grpc-ecosystem/grpc-gateway/issues/395","id":229428238,"number":395,"title":"how to handle arbitrary (json) structs","user":{"login":"lucas-natraj","id":7196683,"avatar_url":"https://avatars2.githubusercontent.com/u/7196683?v=3","gravatar_id":"","url":"https://api.github.com/users/lucas-natraj","html_url":"https://github.com/lucas-natraj","followers_url":"https://api.github.com/users/lucas-natraj/followers","following_url":"https://api.github.com/users/lucas-natraj/following{/other_user}","gists_url":"https://api.github.com/users/lucas-natraj/gists{/gist_id}","starred_url":"https://api.github.com/users/lucas-natraj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucas-natraj/subscriptions","organizations_url":"https://api.github.com/users/lucas-natraj/orgs","repos_url":"https://api.github.com/users/lucas-natraj/repos","events_url":"https://api.github.com/users/lucas-natraj/events{/privacy}","received_events_url":"https://api.github.com/users/lucas-natraj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-17T17:15:45Z","updated_at":"2017-05-17T17:27:55Z","closed_at":null,"body":"i haven't been able to find an example of how to support arbitrary json -> map[string]interface{}.\r\ni've defined my `message` as:\r\n```proto\r\nmessage Entity {\r\n\r\n    // The entity's key.\r\n    string key = 1;\r\n\r\n    // The entity's properties.\r\n    google.protobuf.Struct data = 2;\r\n}\r\n```\r\n\r\nas `Struct` seems to be the appropriate json equivalent in protobuf.\r\n\r\nhowever, i am unable to invoke the corresponding REST endpoint using \r\n```json\r\n{\r\n    \"key\": \"xyz\",\r\n    \"data\": {\r\n        \"name\": \"joe\",\r\n        \"age\": 28\r\n    }\r\n}\r\n```\r\n\r\nis there a way to support arbitrary json content and have it mapped to basically a `map[string]interface{}`?\r\n\r\nnot sure how I need to define my proto messages / services to support this."},"comment":{"url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/comments/302165452","html_url":"https://github.com/grpc-ecosystem/grpc-gateway/issues/395#issuecomment-302165452","issue_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/395","id":302165452,"user":{"login":"TamalSaha","id":94814,"avatar_url":"https://avatars2.githubusercontent.com/u/94814?v=3","gravatar_id":"","url":"https://api.github.com/users/TamalSaha","html_url":"https://github.com/TamalSaha","followers_url":"https://api.github.com/users/TamalSaha/followers","following_url":"https://api.github.com/users/TamalSaha/following{/other_user}","gists_url":"https://api.github.com/users/TamalSaha/gists{/gist_id}","starred_url":"https://api.github.com/users/TamalSaha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TamalSaha/subscriptions","organizations_url":"https://api.github.com/users/TamalSaha/orgs","repos_url":"https://api.github.com/users/TamalSaha/repos","events_url":"https://api.github.com/users/TamalSaha/events{/privacy}","received_events_url":"https://api.github.com/users/TamalSaha/received_events","type":"User","site_admin":false},"created_at":"2017-05-17T17:27:55Z","updated_at":"2017-05-17T17:27:55Z","body":"This is not a gateway question, rather what you can map into protocol buffer. The short answer is, you can't define arbitrary `map[string]interface{}` in protocol buffer.  Please check here: https://developers.google.com/protocol-buffers/docs/proto3#oneof"}}
{"actor":{"display_login":"TamalSaha"}}