{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3348","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3348/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3348/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3348/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3348","id":165098866,"number":3348,"title":"[C#] Enum casing is lost in the generated client","user":{"login":"jdebbink","id":4234835,"avatar_url":"https://avatars.githubusercontent.com/u/4234835?v=3","gravatar_id":"","url":"https://api.github.com/users/jdebbink","html_url":"https://github.com/jdebbink","followers_url":"https://api.github.com/users/jdebbink/followers","following_url":"https://api.github.com/users/jdebbink/following{/other_user}","gists_url":"https://api.github.com/users/jdebbink/gists{/gist_id}","starred_url":"https://api.github.com/users/jdebbink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdebbink/subscriptions","organizations_url":"https://api.github.com/users/jdebbink/orgs","repos_url":"https://api.github.com/users/jdebbink/repos","events_url":"https://api.github.com/users/jdebbink/events{/privacy}","received_events_url":"https://api.github.com/users/jdebbink/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","name":"Enhancement","color":"e5ffe5"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/9","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.0","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/9/labels","id":1375944,"number":9,"title":"v2.2.0","description":"","creator":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":690,"state":"open","created_at":"2015-10-25T23:43:33Z","updated_at":"2016-07-13T13:05:47Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-07-12T14:46:31Z","updated_at":"2016-07-13T14:07:18Z","closed_at":"2016-07-13T12:45:52Z","body":"##### Description\r\n\r\nEnum value casing is not preserved in the generated library\r\n\r\nFor example if there is an enum with the following definition:\r\n```\r\npublic enum MyEnum\r\n{\r\n  InProgress\r\n}\r\n```\r\n\r\nThe genereated enum will look like:\r\n```\r\npublic enum MyEnum\r\n{\r\n   [EnumMember(Value = \"InProgress\")]\r\n   Inprogress  // case is lost\r\n}\r\n```\r\n\r\n##### Swagger-codegen version\r\n\r\n2.1.6\r\n\r\n##### Swagger declaration file content or url\r\n\r\nThe casing is preserved in the swagger definition file\r\n```\r\n{\"swagger\":\"2.0\",\"info\":{\"version\":\"v1\",\"title\":\"WebApplication1\"},\"host\":\"localhost:63332\",\"schemes\":[\"http\"],\"paths\":{\"/api/Values\":{\"post\":{\"tags\":[\"Values\"],\"operationId\":\"Values_Post\",\"consumes\":[\"application/json\",\"text/json\",\"application/xml\",\"text/xml\",\"application/x-www-form-urlencoded\"],\"produces\":[],\"parameters\":[{\"name\":\"value\",\"in\":\"body\",\"required\":true,\"schema\":{\"$ref\":\"#/definitions/MyRequest\"}}],\"responses\":{\"204\":{\"description\":\"No Content\"}},\"deprecated\":false}}},\"definitions\":{\"MyRequest\":{\"type\":\"object\",\"properties\":{\"Status\":{\"enum\":[\"InProgress\"],\"type\":\"string\"}}}}}\r\n```\r\n\r\n##### Command line used for generation\r\n\r\n```\r\njava -jar swagger-codegen-cli.jar generate -i http://localhost:63332/swagger/docs/v1 -l csharp -o CSharpClient/generated/ -D packageName=Test.Service\r\n```\r\n\r\n##### Steps to reproduce\r\n\r\n- In Visual Studio, create a new Web API project\r\n- Add Swashbuckle via nuget\r\n- In ```SwaggerConfig.cs``` add:\r\n```\r\nc.DescribeAllEnumsAsStrings();\r\n```\r\n- In the default API controller add something like the following:\r\n```\r\npublic class MyRequest\r\n\t{\r\n\t\tpublic MyEnum? Status { get; set; }\r\n\t}\r\n\r\n\tpublic enum MyEnum\r\n\t{\r\n\t\t[Display(Name = \"InProgress\")]\r\n\t\tInProgress\r\n\t}\r\n\r\n\tpublic class ValuesController : ApiController\r\n\t{\r\n\t\t[HttpPost]\r\n\t\tpublic void Post(MyRequest value)\r\n\t\t{\r\n\t\t\tConsole.WriteLine(value.Status);\r\n\t\t}\r\n\t}\r\n```\r\n- Launch the project locally and run the code generation:\r\n```\r\njava -jar swagger-codegen-cli.jar generate -i http://localhost:63332/swagger/docs/v1 -l csharp -o CSharpClient/generated/ -D packageName=Test.Service\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/232366001","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3348#issuecomment-232366001","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3348","id":232366001,"user":{"login":"jdebbink","id":4234835,"avatar_url":"https://avatars.githubusercontent.com/u/4234835?v=3","gravatar_id":"","url":"https://api.github.com/users/jdebbink","html_url":"https://github.com/jdebbink","followers_url":"https://api.github.com/users/jdebbink/followers","following_url":"https://api.github.com/users/jdebbink/following{/other_user}","gists_url":"https://api.github.com/users/jdebbink/gists{/gist_id}","starred_url":"https://api.github.com/users/jdebbink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdebbink/subscriptions","organizations_url":"https://api.github.com/users/jdebbink/orgs","repos_url":"https://api.github.com/users/jdebbink/repos","events_url":"https://api.github.com/users/jdebbink/events{/privacy}","received_events_url":"https://api.github.com/users/jdebbink/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T14:07:18Z","updated_at":"2016-07-13T14:07:18Z","body":"That did the trick - thanks!"}}
{"actor":{"display_login":"jdebbink"}}