{"action":"created","issue":{"url":"https://api.github.com/repos/vic/params/issues/4","repository_url":"https://api.github.com/repos/vic/params","labels_url":"https://api.github.com/repos/vic/params/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/vic/params/issues/4/comments","events_url":"https://api.github.com/repos/vic/params/issues/4/events","html_url":"https://github.com/vic/params/issues/4","id":158489877,"number":4,"title":"Default values?","user":{"login":"lasseebert","id":728042,"avatar_url":"https://avatars.githubusercontent.com/u/728042?v=3","gravatar_id":"","url":"https://api.github.com/users/lasseebert","html_url":"https://github.com/lasseebert","followers_url":"https://api.github.com/users/lasseebert/followers","following_url":"https://api.github.com/users/lasseebert/following{/other_user}","gists_url":"https://api.github.com/users/lasseebert/gists{/gist_id}","starred_url":"https://api.github.com/users/lasseebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasseebert/subscriptions","organizations_url":"https://api.github.com/users/lasseebert/orgs","repos_url":"https://api.github.com/users/lasseebert/repos","events_url":"https://api.github.com/users/lasseebert/events{/privacy}","received_events_url":"https://api.github.com/users/lasseebert/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-04T06:02:57Z","updated_at":"2016-06-04T13:38:24Z","closed_at":null,"body":"Thanks for a great library. I'm just learning Elixir, so I might miss something obvious here.\r\n\r\nIs it possible to somehow specify default values in a schema?\r\n\r\nI have something like this:\r\n\r\n```elixir\r\ndefparams index_params %{\r\n  filter: %{\r\n    foo_id: :integer,\r\n    bar_id: :integer\r\n  },\r\n  page: %{\r\n    number: :integer,\r\n    size: :integer\r\n  },\r\n  sort: :string\r\n}\r\n```\r\n\r\n`filter` is not required, but it should default to `%{}`.\r\n`page` is not required, but it should default to e.g. `%{number: 1, size: 20}`.\r\n`sort` is not required, and should default to e.g. `\"id\"`\r\n\r\nI could of course write a function that adds the default values, but since `Ecto.Schema` supports this it could be nice to somehow specify it directly in the schema."},"comment":{"url":"https://api.github.com/repos/vic/params/issues/comments/223756143","html_url":"https://github.com/vic/params/issues/4#issuecomment-223756143","issue_url":"https://api.github.com/repos/vic/params/issues/4","id":223756143,"user":{"login":"lasseebert","id":728042,"avatar_url":"https://avatars.githubusercontent.com/u/728042?v=3","gravatar_id":"","url":"https://api.github.com/users/lasseebert","html_url":"https://github.com/lasseebert","followers_url":"https://api.github.com/users/lasseebert/followers","following_url":"https://api.github.com/users/lasseebert/following{/other_user}","gists_url":"https://api.github.com/users/lasseebert/gists{/gist_id}","starred_url":"https://api.github.com/users/lasseebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lasseebert/subscriptions","organizations_url":"https://api.github.com/users/lasseebert/orgs","repos_url":"https://api.github.com/users/lasseebert/repos","events_url":"https://api.github.com/users/lasseebert/events{/privacy}","received_events_url":"https://api.github.com/users/lasseebert/received_events","type":"User","site_admin":false},"created_at":"2016-06-04T13:38:24Z","updated_at":"2016-06-04T13:38:24Z","body":"Wow, that was fast, thanks. \r\nIt seems like exactly what I need. I will test it later on my own project and provide some feedback. "}}
{"actor":{"display_login":"lasseebert"}}