{"action":"created","issue":{"url":"https://api.github.com/repos/goadesign/goa/issues/244","repository_url":"https://api.github.com/repos/goadesign/goa","labels_url":"https://api.github.com/repos/goadesign/goa/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/goadesign/goa/issues/244/comments","events_url":"https://api.github.com/repos/goadesign/goa/issues/244/events","html_url":"https://github.com/goadesign/goa/issues/244","id":130529786,"number":244,"title":"Nested attribute presence validation issue","user":{"login":"konstantin-dzreev","id":52270,"avatar_url":"https://avatars.githubusercontent.com/u/52270?v=3","gravatar_id":"","url":"https://api.github.com/users/konstantin-dzreev","html_url":"https://github.com/konstantin-dzreev","followers_url":"https://api.github.com/users/konstantin-dzreev/followers","following_url":"https://api.github.com/users/konstantin-dzreev/following{/other_user}","gists_url":"https://api.github.com/users/konstantin-dzreev/gists{/gist_id}","starred_url":"https://api.github.com/users/konstantin-dzreev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konstantin-dzreev/subscriptions","organizations_url":"https://api.github.com/users/konstantin-dzreev/orgs","repos_url":"https://api.github.com/users/konstantin-dzreev/repos","events_url":"https://api.github.com/users/konstantin-dzreev/events{/privacy}","received_events_url":"https://api.github.com/users/konstantin-dzreev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/goadesign/goa/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/goadesign/goa/milestones/1","html_url":"https://github.com/goadesign/goa/milestones/v1","labels_url":"https://api.github.com/repos/goadesign/goa/milestones/1/labels","id":1571984,"number":1,"title":"v1","description":"Initial stable release of goa.","creator":{"login":"raphael","id":36822,"avatar_url":"https://avatars.githubusercontent.com/u/36822?v=3","gravatar_id":"","url":"https://api.github.com/users/raphael","html_url":"https://github.com/raphael","followers_url":"https://api.github.com/users/raphael/followers","following_url":"https://api.github.com/users/raphael/following{/other_user}","gists_url":"https://api.github.com/users/raphael/gists{/gist_id}","starred_url":"https://api.github.com/users/raphael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raphael/subscriptions","organizations_url":"https://api.github.com/users/raphael/orgs","repos_url":"https://api.github.com/users/raphael/repos","events_url":"https://api.github.com/users/raphael/events{/privacy}","received_events_url":"https://api.github.com/users/raphael/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":1,"state":"open","created_at":"2016-02-09T05:30:13Z","updated_at":"2016-02-09T23:40:27Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-02-02T00:37:52Z","updated_at":"2016-02-11T15:54:26Z","closed_at":null,"body":"Here is my setup and test cases. The case #3 reveals unexpected results:\r\n```golang\r\nvar MyRefType = Type(\"MyRefType\", func() {\r\n\tAttribute(\"href\", String, \"Description\", func() {\r\n\t\tPattern(`^zombieeeeee`)\r\n\t})\r\n\tRequired(\"href\")\r\n})\r\n\r\nvar MyPayloadType = Type(\"MyPayloadType\", func() {\r\n\tDescription(\"MyPayloadType blah-blah\")\r\n\tAttribute(\"zombie\", MyRefType)\r\n\tRequired(\"zombie\")\r\n})\r\n\r\nvar _ = Resource(\"foo\", func() {\r\n\tBasePath(\"/foo\")\r\n\tAction(\"bar\", func() {\r\n\t\tRouting(PUT(\"/kill\"))\r\n\t\tPayload(MyPayloadType, func() {\r\n\t\t\tRequired(\"zombie\")\r\n\t\t})\r\n\t\tResponse(NoContent)\r\n\t\tResponse(BadRequest)\r\n\t\tResponse(Forbidden)\r\n\t})\r\n})\r\n\r\nTest cases:\r\n    1. Payload: {}                           #=> OK: \"zombie attribute is missing error\"\r\n    2. Payload: {\"zombie\":{}}                #=> OK: \"href attribute is missing error\"\r\n    3. Payload: {\"zombie\":{\"href\":\"\"}}       #=> FAIL: (no error, but \"href attribute is missing error\" is expected)\r\n    4. Payload: {\"zombie\":{\"href\":\"banana\"}} #=> OK: \"regexp mismatch error\"\r\n```"},"comment":{"url":"https://api.github.com/repos/goadesign/goa/issues/comments/182929671","html_url":"https://github.com/goadesign/goa/issues/244#issuecomment-182929671","issue_url":"https://api.github.com/repos/goadesign/goa/issues/244","id":182929671,"user":{"login":"jim-slattery-rs","id":4665139,"avatar_url":"https://avatars.githubusercontent.com/u/4665139?v=3","gravatar_id":"","url":"https://api.github.com/users/jim-slattery-rs","html_url":"https://github.com/jim-slattery-rs","followers_url":"https://api.github.com/users/jim-slattery-rs/followers","following_url":"https://api.github.com/users/jim-slattery-rs/following{/other_user}","gists_url":"https://api.github.com/users/jim-slattery-rs/gists{/gist_id}","starred_url":"https://api.github.com/users/jim-slattery-rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jim-slattery-rs/subscriptions","organizations_url":"https://api.github.com/users/jim-slattery-rs/orgs","repos_url":"https://api.github.com/users/jim-slattery-rs/repos","events_url":"https://api.github.com/users/jim-slattery-rs/events{/privacy}","received_events_url":"https://api.github.com/users/jim-slattery-rs/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T15:54:26Z","updated_at":"2016-02-11T15:54:26Z","body":"Actually, with the latest code, I think Case 3 now returns a \"regexp mismatch error\"."}}