{"action":"created","issue":{"url":"https://api.github.com/repos/go-yaml/yaml/issues/86","labels_url":"https://api.github.com/repos/go-yaml/yaml/issues/86/labels{/name}","comments_url":"https://api.github.com/repos/go-yaml/yaml/issues/86/comments","events_url":"https://api.github.com/repos/go-yaml/yaml/issues/86/events","html_url":"https://github.com/go-yaml/yaml/pull/86","id":58835099,"number":86,"title":"decode: add mapping key transform hook","user":{"login":"crawford","id":368848,"avatar_url":"https://avatars.githubusercontent.com/u/368848?v=3","gravatar_id":"","url":"https://api.github.com/users/crawford","html_url":"https://github.com/crawford","followers_url":"https://api.github.com/users/crawford/followers","following_url":"https://api.github.com/users/crawford/following{/other_user}","gists_url":"https://api.github.com/users/crawford/gists{/gist_id}","starred_url":"https://api.github.com/users/crawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawford/subscriptions","organizations_url":"https://api.github.com/users/crawford/orgs","repos_url":"https://api.github.com/users/crawford/repos","events_url":"https://api.github.com/users/crawford/events{/privacy}","received_events_url":"https://api.github.com/users/crawford/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-25T01:20:57Z","updated_at":"2015-09-29T06:12:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/go-yaml/yaml/pulls/86","html_url":"https://github.com/go-yaml/yaml/pull/86","diff_url":"https://github.com/go-yaml/yaml/pull/86.diff","patch_url":"https://github.com/go-yaml/yaml/pull/86.patch"},"body":"This hook allows the user to apply a custom transform to mapping keys\r\nduring unmarshalling."},"comment":{"url":"https://api.github.com/repos/go-yaml/yaml/issues/comments/143956278","html_url":"https://github.com/go-yaml/yaml/pull/86#issuecomment-143956278","issue_url":"https://api.github.com/repos/go-yaml/yaml/issues/86","id":143956278,"user":{"login":"crawford","id":368848,"avatar_url":"https://avatars.githubusercontent.com/u/368848?v=3","gravatar_id":"","url":"https://api.github.com/users/crawford","html_url":"https://github.com/crawford","followers_url":"https://api.github.com/users/crawford/followers","following_url":"https://api.github.com/users/crawford/following{/other_user}","gists_url":"https://api.github.com/users/crawford/gists{/gist_id}","starred_url":"https://api.github.com/users/crawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawford/subscriptions","organizations_url":"https://api.github.com/users/crawford/orgs","repos_url":"https://api.github.com/users/crawford/repos","events_url":"https://api.github.com/users/crawford/events{/privacy}","received_events_url":"https://api.github.com/users/crawford/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T06:12:14Z","updated_at":"2015-09-29T06:12:14Z","body":"The particular case that I had in mind was unmarshalling cloud-configs, where `-` and `_` can be used interchangeably. Using yaml.Unmarshaler seems like it would be very cumbersome. Unless I am mistaken, all non-leaf elements would need to have a custom Unmarshaler, in which it would need to unmarshal into a map as an intermediate step. I want to avoid using a map altogether since that basically throws away the type system. I depend heavily on the structured types in order to validate user input.\r\n\r\nI agree that applying transforms to YAML keys is fairly uncommon, but I couldn't think of a better way to solve this issue."}}