{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/fast-dna/issues/753","repository_url":"https://api.github.com/repos/Microsoft/fast-dna","labels_url":"https://api.github.com/repos/Microsoft/fast-dna/issues/753/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/fast-dna/issues/753/comments","events_url":"https://api.github.com/repos/Microsoft/fast-dna/issues/753/events","html_url":"https://github.com/Microsoft/fast-dna/issues/753","id":346904554,"node_id":"MDU6SXNzdWUzNDY5MDQ1NTQ=","number":753,"title":"Allow FormItemSelect to return a number instead of string only","user":{"login":"brandonthomas","id":7529639,"node_id":"MDQ6VXNlcjc1Mjk2Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/7529639?v=4","gravatar_id":"","url":"https://api.github.com/users/brandonthomas","html_url":"https://github.com/brandonthomas","followers_url":"https://api.github.com/users/brandonthomas/followers","following_url":"https://api.github.com/users/brandonthomas/following{/other_user}","gists_url":"https://api.github.com/users/brandonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonthomas/subscriptions","organizations_url":"https://api.github.com/users/brandonthomas/orgs","repos_url":"https://api.github.com/users/brandonthomas/repos","events_url":"https://api.github.com/users/brandonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/brandonthomas/received_events","type":"User","site_admin":false},"labels":[{"id":854394582,"node_id":"MDU6TGFiZWw4NTQzOTQ1ODI=","url":"https://api.github.com/repos/Microsoft/fast-dna/labels/feature%20request","name":"feature request","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-02T08:09:54Z","updated_at":"2018-08-07T17:38:31Z","closed_at":null,"author_association":"NONE","body":"When handling enums it's sometimes necessary to do so using the underlying type (number/int). It would be great if, when specifying enum, I could set the type on the field to number and have a number returned instead of the string value. I think a mapping strategy would need to be thought out since not all enums are computed.\r\n\r\nExisting:\r\n`enum: [\r\n  \"large\",\r\n  \"medium\"\r\n]`\r\n\r\nFuture?\r\n`enum: {\r\n  \"large\": 1,\r\n  \"medium\": 4\r\n}`"},"comment":{"url":"https://api.github.com/repos/Microsoft/fast-dna/issues/comments/411140323","html_url":"https://github.com/Microsoft/fast-dna/issues/753#issuecomment-411140323","issue_url":"https://api.github.com/repos/Microsoft/fast-dna/issues/753","id":411140323,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTE0MDMyMw==","user":{"login":"brandonthomas","id":7529639,"node_id":"MDQ6VXNlcjc1Mjk2Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/7529639?v=4","gravatar_id":"","url":"https://api.github.com/users/brandonthomas","html_url":"https://github.com/brandonthomas","followers_url":"https://api.github.com/users/brandonthomas/followers","following_url":"https://api.github.com/users/brandonthomas/following{/other_user}","gists_url":"https://api.github.com/users/brandonthomas/gists{/gist_id}","starred_url":"https://api.github.com/users/brandonthomas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandonthomas/subscriptions","organizations_url":"https://api.github.com/users/brandonthomas/orgs","repos_url":"https://api.github.com/users/brandonthomas/repos","events_url":"https://api.github.com/users/brandonthomas/events{/privacy}","received_events_url":"https://api.github.com/users/brandonthomas/received_events","type":"User","site_admin":false},"created_at":"2018-08-07T17:38:31Z","updated_at":"2018-08-07T17:38:31Z","author_association":"NONE","body":"The issue I’m having here is basically that when I pass an enum I only get a string back when a selection is made. Since most languages use an int/number as the underlying type of enum I’d expect to get that back instead. The reason for this is that at runtime the component I’m feeding the data into needs an int. A string not associated with anything doesn’t work. To mitigate this I have to do the conversion in runtime on my side in my Redux reducers and in my render method (neither are ideal). If I could just get an int/number back I could remove all that code and just use the raw data.\r\n\r\nBrandon\r\n\r\nFrom: Nicholas Rice <notifications@github.com>\r\nSent: Monday, August 6, 2018 11:32 AM\r\nTo: Microsoft/fast-dna <fast-dna@noreply.github.com>\r\nCc: Brandon Thomas <brandth@microsoft.com>; Author <author@noreply.github.com>\r\nSubject: Re: [Microsoft/fast-dna] Allow FormItemSelect to return a number instead of string only (#753)\r\n\r\n\r\nThanks Brandon,\r\n\r\nI don't think I fully understand the issue. In your code sample, are you refering to enumerating a number JSON schema?\r\n\r\n—\r\nYou are receiving this because you authored the thread.\r\nReply to this email directly, view it on GitHub<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Ffast-dna%2Fissues%2F753%23issuecomment-410807181&data=02%7C01%7Cbrandth%40microsoft.com%7C06138d57858946ddedb808d5fbcae17d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636691771140121914&sdata=XGHNAoHWhwzc3nUZ1EIwoTGlN2P6kQ7bLDXUO5pBS9Y%3D&reserved=0>, or mute the thread<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAHLkpyrWpBxLy2yD16jblDad6akHX4fZks5uOIuYgaJpZM4Vr0w_&data=02%7C01%7Cbrandth%40microsoft.com%7C06138d57858946ddedb808d5fbcae17d%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636691771140131922&sdata=%2FepovUnG181syq9CHZTlpHoOvkzgBsUHyb6IIohWUx0%3D&reserved=0>.\r\n"}}
{"actor":{"display_login":"brandonthomas"}}