{"action":"opened","issue":{"url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/62","repository_url":"https://api.github.com/repos/buildo/metarpheus-io-ts","labels_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/62/comments","events_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/62/events","html_url":"https://github.com/buildo/metarpheus-io-ts/issues/62","id":391666047,"node_id":"MDU6SXNzdWUzOTE2NjYwNDc=","number":62,"title":"Enum Types become strings when used as map keys","user":{"login":"MatteoTurri","id":5755344,"node_id":"MDQ6VXNlcjU3NTUzNDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5755344?v=4","gravatar_id":"","url":"https://api.github.com/users/MatteoTurri","html_url":"https://github.com/MatteoTurri","followers_url":"https://api.github.com/users/MatteoTurri/followers","following_url":"https://api.github.com/users/MatteoTurri/following{/other_user}","gists_url":"https://api.github.com/users/MatteoTurri/gists{/gist_id}","starred_url":"https://api.github.com/users/MatteoTurri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatteoTurri/subscriptions","organizations_url":"https://api.github.com/users/MatteoTurri/orgs","repos_url":"https://api.github.com/users/MatteoTurri/repos","events_url":"https://api.github.com/users/MatteoTurri/events{/privacy}","received_events_url":"https://api.github.com/users/MatteoTurri/received_events","type":"User","site_admin":false},"labels":[{"id":576176063,"node_id":"MDU6TGFiZWw1NzYxNzYwNjM=","url":"https://api.github.com/repos/buildo/metarpheus-io-ts/labels/defect","name":"defect","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-17T11:18:38Z","updated_at":"2018-12-17T11:18:38Z","closed_at":null,"author_association":"NONE","body":"## description\r\nAn Enum type used as key of a map is replaced by a string key in the generated model, even though the Enum type is converted correctly.\r\n\r\n## how to reproduce\r\n\r\nIf in the scala source we have a case class with a map that uses an enum as key, like in the following example:\r\n```\r\ncase class Location(\r\n  ...,\r\n  openingHours: Map[DayOfWeek, List[OpeningHours]],\r\n  ...\r\n)\r\n```\r\nwhere DayOfWeek is defined as:\r\n\r\n```\r\n@indexedEnum trait DayOfWeek {\r\n  type Index = JavaDayOfWeek\r\n  object Monday { JavaDayOfWeek.MONDAY }\r\n  object Tuesday { JavaDayOfWeek.TUESDAY }\r\n  object Wednesday { JavaDayOfWeek.WEDNESDAY }\r\n  object Thursday { JavaDayOfWeek.THURSDAY }\r\n  object Friday { JavaDayOfWeek.FRIDAY }\r\n  object Saturday { JavaDayOfWeek.SATURDAY }\r\n  object Sunday { JavaDayOfWeek.SUNDAY }\r\n}\r\n```\r\n\r\nthe generated TS model has string keys\r\n\r\n```\r\nexport interface Location {\r\n  ...,\r\n  openingHours: { [key: string]: Array<OpeningHours> },\r\n  ...\r\n}\r\n```\r\neven though the Enum type is generated.\r\n\r\n```\r\nexport type DayOfWeek =\r\n  | 'Monday'\r\n  | 'Tuesday'\r\n  | 'Wednesday'\r\n  | 'Thursday'\r\n  | 'Friday'\r\n  | 'Saturday'\r\n  | 'Sunday'\r\n\r\nexport const DayOfWeek = t.keyof({\r\n  Monday: true,\r\n  Tuesday: true,\r\n  Wednesday: true,\r\n  Thursday: true,\r\n  Friday: true,\r\n  Saturday: true,\r\n  Sunday: true\r\n}, 'DayOfWeek')\r\n```\r\n"}}
{"actor":{"display_login":"MatteoTurri"}}