{"action":"closed","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3295","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3295/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3295/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3295/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3295","id":163823312,"number":3295,"title":"[csharp] add header problem due to static method for adding header","user":{"login":"lunat","id":6884049,"avatar_url":"https://avatars.githubusercontent.com/u/6884049?v=3","gravatar_id":"","url":"https://api.github.com/users/lunat","html_url":"https://github.com/lunat","followers_url":"https://api.github.com/users/lunat/followers","following_url":"https://api.github.com/users/lunat/following{/other_user}","gists_url":"https://api.github.com/users/lunat/gists{/gist_id}","starred_url":"https://api.github.com/users/lunat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunat/subscriptions","organizations_url":"https://api.github.com/users/lunat/orgs","repos_url":"https://api.github.com/users/lunat/repos","events_url":"https://api.github.com/users/lunat/events{/privacy}","received_events_url":"https://api.github.com/users/lunat/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Client:%20C-Sharp","name":"Client: C-Sharp","color":"fad8c7"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Enhancement:%20General","name":"Enhancement: General","color":"e5ffe5"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/13","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.2","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/13/labels","id":1928763,"number":13,"title":"v2.2.2","description":"","creator":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"open_issues":240,"closed_issues":144,"state":"open","created_at":"2016-08-08T09:16:56Z","updated_at":"2016-09-13T10:18:18Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2016-07-05T10:52:23Z","updated_at":"2016-09-13T10:18:18Z","closed_at":"2016-09-13T10:18:18Z","body":"##### Description\r\n\r\nAdding an header value may cause a duplicate Header issue because the list is static.\r\nFurthermore it could be useful adding a method that sets up the Api Key\r\n\r\n##### Swagger-codegen version\r\n\r\n2.2.0\r\n\r\n##### Suggest a Fix\r\n\r\nIn file \"Configuration.mustache\"\r\nchange line 159\r\n\r\n```\r\n        public void AddDefaultHeader(string key, string value)\r\n        {\r\n            _defaultHeaderMap.Add(key, value);\r\n        }\r\n```\r\n\r\nto\r\n\r\n```\r\n        public void AddDefaultHeader(string key, string value)\r\n        {\r\n            if (_defaultHeaderMap.ContainsKey(key))\r\n                _defaultHeaderMap.Remove(key);\r\n            _defaultHeaderMap.Add(key, value);\r\n        }\r\n```\r\n\r\nAnd Add\r\n```\r\n        public void AddApiKey(string key, string value)\r\n        {\r\n            if (ApiKey.ContainsKey(key))\r\n                ApiKey.Remove(key);\r\n            ApiKey.Add(key, value);\r\n        }\r\n\r\n        public void AddApiKeyPrefix(string key, string value)\r\n        {\r\n            if (ApiKeyPrefix.ContainsKey(key))\r\n                ApiKeyPrefix.Remove(key);\r\n            ApiKeyPrefix.Add(key, value);\r\n        }\r\n```"}}
{"actor":{"display_login":"wing328"}}