{"action":"opened","issue":{"url":"https://api.github.com/repos/go-playground/form/issues/10","repository_url":"https://api.github.com/repos/go-playground/form","labels_url":"https://api.github.com/repos/go-playground/form/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/go-playground/form/issues/10/comments","events_url":"https://api.github.com/repos/go-playground/form/issues/10/events","html_url":"https://github.com/go-playground/form/issues/10","id":172429793,"number":10,"title":"Option to ignore all struct fields not explicitly tagged via struct tag","user":{"login":"annismckenzie","id":16936,"avatar_url":"https://avatars.githubusercontent.com/u/16936?v=3","gravatar_id":"","url":"https://api.github.com/users/annismckenzie","html_url":"https://github.com/annismckenzie","followers_url":"https://api.github.com/users/annismckenzie/followers","following_url":"https://api.github.com/users/annismckenzie/following{/other_user}","gists_url":"https://api.github.com/users/annismckenzie/gists{/gist_id}","starred_url":"https://api.github.com/users/annismckenzie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annismckenzie/subscriptions","organizations_url":"https://api.github.com/users/annismckenzie/orgs","repos_url":"https://api.github.com/users/annismckenzie/repos","events_url":"https://api.github.com/users/annismckenzie/events{/privacy}","received_events_url":"https://api.github.com/users/annismckenzie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-22T11:28:48Z","updated_at":"2016-08-22T11:28:48Z","closed_at":null,"body":"In the README there's a section about ignoring fields by tagging them with `form:\"-\"`. Would it be possible to add an option to the decoder (like `SetTagName(tagName string)`) to ignore all struct fields not explicitly tagged with `form:\"fieldName\"` (or the custom tag name if set)?\r\n\r\nThe problem I see is the unintended injection of data because this library is used with user-generated content and accepts form data. Having a language like Go that is strictly typed goes a long way but I do have to go through all of my models and tag them with `form:\"-\"`. Still, I know this is my fault and want to thank you for this awesome library!\r\n\r\nThe reason I'm asking is that I'm also using these structs that are filled with form data to also transform the data for later usage. Sometimes there's additional fields I add that need to be public to use within the app but are not supposed to be accepted via the form data. I'm also always tagging all fields I accept even if the form field's name is the lowercased version of the struct field name (so technically, I wouldn't have to add the struct tag) but you immediately see what's accepted via a form and what's not when looking at the struct definition.\r\n\r\nIf this is a request you'd rather not implement then a few pointers on how to make this safer for me or where you'd start looking in the code. :)"}}
{"actor":{"display_login":"annismckenzie"}}