{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/8180","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/8180/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/8180/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/8180/events","html_url":"https://github.com/aspnet/Mvc/issues/8180","id":346151976,"node_id":"MDU6SXNzdWUzNDYxNTE5NzY=","number":8180,"title":"BindRequired doesn't work for arrays","user":{"login":"StevenLiekens","id":1583241,"node_id":"MDQ6VXNlcjE1ODMyNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/1583241?v=4","gravatar_id":"","url":"https://api.github.com/users/StevenLiekens","html_url":"https://github.com/StevenLiekens","followers_url":"https://api.github.com/users/StevenLiekens/followers","following_url":"https://api.github.com/users/StevenLiekens/following{/other_user}","gists_url":"https://api.github.com/users/StevenLiekens/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenLiekens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenLiekens/subscriptions","organizations_url":"https://api.github.com/users/StevenLiekens/orgs","repos_url":"https://api.github.com/users/StevenLiekens/repos","events_url":"https://api.github.com/users/StevenLiekens/events{/privacy}","received_events_url":"https://api.github.com/users/StevenLiekens/received_events","type":"User","site_admin":false},"labels":[{"id":93054384,"node_id":"MDU6TGFiZWw5MzA1NDM4NA==","url":"https://api.github.com/repos/aspnet/Mvc/labels/3%20-%20Done","name":"3 - Done","color":"CCCCCC","default":false},{"id":905219845,"node_id":"MDU6TGFiZWw5MDUyMTk4NDU=","url":"https://api.github.com/repos/aspnet/Mvc/labels/PRI:%201%20-%20Required","name":"PRI: 1 - Required","color":"6966f9","default":false},{"id":70264660,"node_id":"MDU6TGFiZWw3MDI2NDY2MA==","url":"https://api.github.com/repos/aspnet/Mvc/labels/bug","name":"bug","color":"fc2929","default":true},{"id":852078090,"node_id":"MDU6TGFiZWw4NTIwNzgwOTA=","url":"https://api.github.com/repos/aspnet/Mvc/labels/cost:%20S","name":"cost: S","color":"ffeeee","default":false}],"state":"closed","locked":false,"assignee":{"login":"dougbu","id":6431421,"node_id":"MDQ6VXNlcjY0MzE0MjE=","avatar_url":"https://avatars1.githubusercontent.com/u/6431421?v=4","gravatar_id":"","url":"https://api.github.com/users/dougbu","html_url":"https://github.com/dougbu","followers_url":"https://api.github.com/users/dougbu/followers","following_url":"https://api.github.com/users/dougbu/following{/other_user}","gists_url":"https://api.github.com/users/dougbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dougbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougbu/subscriptions","organizations_url":"https://api.github.com/users/dougbu/orgs","repos_url":"https://api.github.com/users/dougbu/repos","events_url":"https://api.github.com/users/dougbu/events{/privacy}","received_events_url":"https://api.github.com/users/dougbu/received_events","type":"User","site_admin":false},"assignees":[{"login":"dougbu","id":6431421,"node_id":"MDQ6VXNlcjY0MzE0MjE=","avatar_url":"https://avatars1.githubusercontent.com/u/6431421?v=4","gravatar_id":"","url":"https://api.github.com/users/dougbu","html_url":"https://github.com/dougbu","followers_url":"https://api.github.com/users/dougbu/followers","following_url":"https://api.github.com/users/dougbu/following{/other_user}","gists_url":"https://api.github.com/users/dougbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dougbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougbu/subscriptions","organizations_url":"https://api.github.com/users/dougbu/orgs","repos_url":"https://api.github.com/users/dougbu/repos","events_url":"https://api.github.com/users/dougbu/events{/privacy}","received_events_url":"https://api.github.com/users/dougbu/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/aspnet/Mvc/milestones/54","html_url":"https://github.com/aspnet/Mvc/milestone/54","labels_url":"https://api.github.com/repos/aspnet/Mvc/milestones/54/labels","id":3417322,"node_id":"MDk6TWlsZXN0b25lMzQxNzMyMg==","number":54,"title":"2.2.0-preview3","description":"","creator":{"login":"pranavkm","id":174281,"node_id":"MDQ6VXNlcjE3NDI4MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/174281?v=4","gravatar_id":"","url":"https://api.github.com/users/pranavkm","html_url":"https://github.com/pranavkm","followers_url":"https://api.github.com/users/pranavkm/followers","following_url":"https://api.github.com/users/pranavkm/following{/other_user}","gists_url":"https://api.github.com/users/pranavkm/gists{/gist_id}","starred_url":"https://api.github.com/users/pranavkm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pranavkm/subscriptions","organizations_url":"https://api.github.com/users/pranavkm/orgs","repos_url":"https://api.github.com/users/pranavkm/repos","events_url":"https://api.github.com/users/pranavkm/events{/privacy}","received_events_url":"https://api.github.com/users/pranavkm/received_events","type":"User","site_admin":false},"open_issues":37,"closed_issues":24,"state":"open","created_at":"2018-06-11T22:27:37Z","updated_at":"2018-09-21T21:50:31Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2018-07-31T11:45:54Z","updated_at":"2018-09-22T10:40:13Z","closed_at":"2018-09-21T21:50:30Z","author_association":"NONE","body":"#### Is this a Bug or Feature request?:\r\nBug\r\n\r\n\r\n#### Steps to reproduce (preferably a link to a GitHub repo with a repro project):\r\nCreate a controller action that expects an array of values FromQuery.\r\nSlap a `BindRequired` attribute on the array param.\r\n\r\n```csharp\r\n[HttpGet(\"todos\")]\r\npublic ActionResult<string[]> GetTodosOnDays([BindRequired, FromQuery] string[] days)\r\n{\r\n    if (!ModelState.IsValid)\r\n    {\r\n        return BadRequest(ModelState);\r\n    }\r\n    return TodosApi.GetTodosOnDays(days);\r\n}\r\n```\r\n\r\nExample usage for the happy path:\r\n```\r\nGET http://localhost:5000/todos?days=Friday&days=Saturday\r\n\r\n200 OK\r\n\r\n[ \"work hard\", \"party hard\" ]\r\n```\r\n\r\n#### Description of the problem:\r\n\r\nDoing a GET without a query string doesn't invalidate `ModelState`\r\n\r\n`GET http://localhost:5000/todos`\r\n\r\n```csharp\r\n[HttpGet(\"todos\")]\r\npublic ActionResult<string[]> GetTodosOnDays([BindRequired, FromQuery] string[] days)\r\n{\r\n    // days.Length == 0\r\n    // ModelState.IsValid == true\r\n    if (!ModelState.IsValid)\r\n    {\r\n        // never reached\r\n        return BadRequest(ModelState);\r\n    }\r\n    // crash\r\n    return TodosApi.GetTodosOnDays(days);\r\n}\r\n```\r\n\r\nExpected result:\r\n\r\n```\r\n400 Bad Request\r\n\r\n{\r\n    \"days\": [\r\n        \"A value for the 'days' property was not provided.\"\r\n    ]\r\n}\r\n```\r\n\r\n#### Version of `Microsoft.AspNetCore.Mvc` or `Microsoft.AspNetCore.App` or `Microsoft.AspNetCore.All`:\r\n2.1.1\r\n\r\n\r\n<!--\r\n                                    --- NOTE ---\r\n1.  Try enabling logging (in the most verbose level) and see if the details help you in fixing\r\n    the issue you are seeing. Share the logs too if it helps in diagnosing the issue faster.\r\n    More info: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging\r\n\r\n2.  If you are seeing an exception, include the full exceptions details (message and stack trace).\r\n    More info: https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling\r\n\r\n3.  If you believe you have an issue that affects the security of the platform please do\r\n    not create an issue, instead email your issue to 'secure@microsoft.com'. Your report may\r\n    be eligible for our bug bounty. More info: https://technet.microsoft.com/en-us/mt764065.aspx\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/423734771","html_url":"https://github.com/aspnet/Mvc/issues/8180#issuecomment-423734771","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/8180","id":423734771,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzczNDc3MQ==","user":{"login":"StevenLiekens","id":1583241,"node_id":"MDQ6VXNlcjE1ODMyNDE=","avatar_url":"https://avatars3.githubusercontent.com/u/1583241?v=4","gravatar_id":"","url":"https://api.github.com/users/StevenLiekens","html_url":"https://github.com/StevenLiekens","followers_url":"https://api.github.com/users/StevenLiekens/followers","following_url":"https://api.github.com/users/StevenLiekens/following{/other_user}","gists_url":"https://api.github.com/users/StevenLiekens/gists{/gist_id}","starred_url":"https://api.github.com/users/StevenLiekens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StevenLiekens/subscriptions","organizations_url":"https://api.github.com/users/StevenLiekens/orgs","repos_url":"https://api.github.com/users/StevenLiekens/repos","events_url":"https://api.github.com/users/StevenLiekens/events{/privacy}","received_events_url":"https://api.github.com/users/StevenLiekens/received_events","type":"User","site_admin":false},"created_at":"2018-09-22T10:40:13Z","updated_at":"2018-09-22T10:40:13Z","author_association":"NONE","body":"Thanks"}}
{"actor":{"display_login":"StevenLiekens"}}