{"action":"created","issue":{"url":"https://api.github.com/repos/heldersepu/Swagger-Net/issues/40","repository_url":"https://api.github.com/repos/heldersepu/Swagger-Net","labels_url":"https://api.github.com/repos/heldersepu/Swagger-Net/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/heldersepu/Swagger-Net/issues/40/comments","events_url":"https://api.github.com/repos/heldersepu/Swagger-Net/issues/40/events","html_url":"https://github.com/heldersepu/Swagger-Net/issues/40","id":297807018,"number":40,"title":"ApiVersion parameter in query instead header","user":{"login":"ecoburotic","id":35916210,"avatar_url":"https://avatars0.githubusercontent.com/u/35916210?v=4","gravatar_id":"","url":"https://api.github.com/users/ecoburotic","html_url":"https://github.com/ecoburotic","followers_url":"https://api.github.com/users/ecoburotic/followers","following_url":"https://api.github.com/users/ecoburotic/following{/other_user}","gists_url":"https://api.github.com/users/ecoburotic/gists{/gist_id}","starred_url":"https://api.github.com/users/ecoburotic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecoburotic/subscriptions","organizations_url":"https://api.github.com/users/ecoburotic/orgs","repos_url":"https://api.github.com/users/ecoburotic/repos","events_url":"https://api.github.com/users/ecoburotic/events{/privacy}","received_events_url":"https://api.github.com/users/ecoburotic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-16T14:42:32Z","updated_at":"2018-02-16T15:08:17Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI thinks have found a bug in parameter generation.\r\n\r\nI recently use MultipleApiVersions instead SingleApiVersion.\r\n\r\nWe use header param for ApiVersionning (because we don't want change URL at each version) but that not work in Swagger (but a simple REST call works fine!)\r\n\r\nSwagger thinks my param is a query param but not, it's an header param.\r\n\r\nYou can see my hotfix here : https://github.com/ecoburotic/Swagger-Net/commit/d148de13f80a5110c8781b7e13c62d8b39c135cc\r\n\r\nI can't make a pull requests because I have other commits.\r\n\r\n\r\nMy server code (for information, if that can help you to reproduice)\r\n\r\nIn WebApiConfig.cs\r\n```\r\n // Configuration et services API Web\r\n config.AddApiVersioning(o =>\r\n {\r\n     o.ReportApiVersions = true;\r\n     o.AssumeDefaultVersionWhenUnspecified = false;\r\n     o.ApiVersionReader = new HeaderApiVersionReader(\"api-version\");\r\n     o.ApiVersionSelector = new CurrentImplementationApiVersionSelector(o);\r\n });\r\n \r\n var apiExplorer = config.AddVersionedApiExplorer(options =>\r\n {\r\n     options.GroupNameFormat = \"V.V\";\r\n     options.DefaultApiVersionParameterDescription = \"Version de l'API\";\r\n });\r\n```\r\n\r\nIn SwaggerConfig.cs\r\n```\r\n c.MultipleApiVersions(\r\n     (apiDesc, targetApiVersion) =>\r\n     {\r\n         targetApiVersion = targetApiVersion[0] + \".\" + targetApiVersion[1];\r\n \r\n         List<string> apiVersions = apiDesc.ActionDescriptor.GetApiVersions().Select(apiVersion => apiVersion.ToString()).ToList();\r\n \r\n         return apiVersions.Contains(targetApiVersion);\r\n     },\r\n     (vc) =>\r\n     {\r\n         var t = GlobalConfiguration.Configuration.Services.GetApiExplorer();\r\n         var t2 = t.ApiDescriptions;\r\n \r\n         foreach (ApiDescriptionGroup item in ((VersionedApiExplorer)t).ApiDescriptions)\r\n         {\r\n             vc.Version(item.ApiVersion.ToString().Replace(\".\", string.Empty), \"EcoServiceREST API v\" + item.ApiVersion.ToString());\r\n         }\r\n     });\r\n```"},"comment":{"url":"https://api.github.com/repos/heldersepu/Swagger-Net/issues/comments/366260885","html_url":"https://github.com/heldersepu/Swagger-Net/issues/40#issuecomment-366260885","issue_url":"https://api.github.com/repos/heldersepu/Swagger-Net/issues/40","id":366260885,"user":{"login":"heldersepu","id":545474,"avatar_url":"https://avatars0.githubusercontent.com/u/545474?v=4","gravatar_id":"","url":"https://api.github.com/users/heldersepu","html_url":"https://github.com/heldersepu","followers_url":"https://api.github.com/users/heldersepu/followers","following_url":"https://api.github.com/users/heldersepu/following{/other_user}","gists_url":"https://api.github.com/users/heldersepu/gists{/gist_id}","starred_url":"https://api.github.com/users/heldersepu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heldersepu/subscriptions","organizations_url":"https://api.github.com/users/heldersepu/orgs","repos_url":"https://api.github.com/users/heldersepu/repos","events_url":"https://api.github.com/users/heldersepu/events{/privacy}","received_events_url":"https://api.github.com/users/heldersepu/received_events","type":"User","site_admin":false},"created_at":"2018-02-16T15:08:17Z","updated_at":"2018-02-16T15:08:17Z","author_association":"OWNER","body":"You say:\r\n> Swagger thinks my param is a query param but not, it's a header param.\r\n\r\nDo you have a sample controller/action(s) showing that?"}}
{"actor":{"display_login":"heldersepu"}}