{"action":"opened","issue":{"url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/753","repository_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway","labels_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/753/labels{/name}","comments_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/753/comments","events_url":"https://api.github.com/repos/grpc-ecosystem/grpc-gateway/issues/753/events","html_url":"https://github.com/grpc-ecosystem/grpc-gateway/issues/753","id":359253182,"node_id":"MDU6SXNzdWUzNTkyNTMxODI=","number":753,"title":"issue with oneof, get, and non-primitive","user":{"login":"venezia","id":6701146,"node_id":"MDQ6VXNlcjY3MDExNDY=","avatar_url":"https://avatars1.githubusercontent.com/u/6701146?v=4","gravatar_id":"","url":"https://api.github.com/users/venezia","html_url":"https://github.com/venezia","followers_url":"https://api.github.com/users/venezia/followers","following_url":"https://api.github.com/users/venezia/following{/other_user}","gists_url":"https://api.github.com/users/venezia/gists{/gist_id}","starred_url":"https://api.github.com/users/venezia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/venezia/subscriptions","organizations_url":"https://api.github.com/users/venezia/orgs","repos_url":"https://api.github.com/users/venezia/repos","events_url":"https://api.github.com/users/venezia/events{/privacy}","received_events_url":"https://api.github.com/users/venezia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-11T22:53:55Z","updated_at":"2018-09-11T22:53:55Z","closed_at":null,"author_association":"NONE","body":"### Steps you follow to reproduce the error:\r\n\r\n- Create a Message that has one ore more nested messages as `oneof` possibilities\r\n\r\n```\r\nmessage GetSomethingMsg {\r\n    string name = 1;\r\n    oneof credentials {\r\n        AWSCredentials aws = 2;\r\n        AzureCredentials azure = 3;\r\n    }\r\n}\r\n\r\nmessage AWSCredentials {\r\n    string secret_key_id = 1;\r\n    string secret_access_key = 2;\r\n    string region = 3;\r\n}\r\n\r\nmessage AzureCredentials {\r\n    string app_id = 1;\r\n    string tenant = 2;\r\n    string password = 3;\r\n    string subscription_id = 4;\r\n}\r\n```\r\n\r\n- Have a service offer to use it with a get and with a post\r\n```\r\nrpc GetSomething (GetSomethingMsg) returns (GetSomethingReply) {\r\n    option (google.api.http) = {\r\n        get : \"/api/v1/something\"\r\n    };\r\n}\r\nrpc GetSomethingV2 (GetSomethingMsg) returns (GetSomethingReply) {\r\n    option (google.api.http) = {\r\n        post : \"/api/v2/something\"\r\n        body : \"*\"\r\n    };\r\n}\r\n```\r\n\r\n- Try using the GET service\r\n\r\n```\r\ncurl \"http://localhost:9050/api/v1/something?name=abc&azure.app_id=abc&azure.tenant=def&azure.password=ghi&azure.subscription_id=jkl\"\r\n{\"error\":\"field already set for credentials oneof\",\"message\":\"field already set for credentials oneof\",\"code\":3}\r\n```\r\n\r\nThe POST will work just fine, as expected\r\n\r\n### What did you expect to happen instead:\r\n\r\nBoth solutions to work\r\n\r\n### What's your theory on why it isn't working:\r\n\r\nI've noticed that if I only set a single value for the nested message, it does not error out.  So if I do\r\n```\r\ncurl \"http://localhost:9050/api/v1/something?name=abc&azure.app_id=abc\"\r\n```\r\nIt will be happy with me - which makes me think there is some glitch in how get parameters are being parsed.  The post is doing fine, so I suspect it has something to do with assembling the get values together into a single object.\r\n\r\nI could totally be wrong too.\r\n\r\nThere are similar issues - https://github.com/grpc-ecosystem/grpc-gateway/issues/460 and https://github.com/grpc-ecosystem/grpc-gateway/issues/413 - but they seem to be different, so I figured the issue was worth filing.\r\n\r\nThanks!"}}
{"actor":{"display_login":"venezia"}}