{"action":"created","issue":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/2049","repository_url":"https://api.github.com/repos/dropwizard/dropwizard","labels_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/2049/labels{/name}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/2049/comments","events_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/2049/events","html_url":"https://github.com/dropwizard/dropwizard/issues/2049","id":227200865,"number":2049,"title":"@NotNull does not work with @Validated(Test.class) annotation","user":{"login":"anujkumar04","id":8241927,"avatar_url":"https://avatars2.githubusercontent.com/u/8241927?v=3","gravatar_id":"","url":"https://api.github.com/users/anujkumar04","html_url":"https://github.com/anujkumar04","followers_url":"https://api.github.com/users/anujkumar04/followers","following_url":"https://api.github.com/users/anujkumar04/following{/other_user}","gists_url":"https://api.github.com/users/anujkumar04/gists{/gist_id}","starred_url":"https://api.github.com/users/anujkumar04/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anujkumar04/subscriptions","organizations_url":"https://api.github.com/users/anujkumar04/orgs","repos_url":"https://api.github.com/users/anujkumar04/repos","events_url":"https://api.github.com/users/anujkumar04/events{/privacy}","received_events_url":"https://api.github.com/users/anujkumar04/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-05-08T23:08:21Z","updated_at":"2017-05-09T01:51:58Z","closed_at":null,"body":"If I annotate a resource method param with @NotNull and @Valid and send a null entity, I correctly get a 400 back. If I annotate it with @NotNull and @Validated and send a null entity again it works. \r\nBut If I annotate it with @NotNull and @Validated(TestValidated.class) and try to send a null entity, it does not do the null check.\r\nSample code:\r\n\r\n```java\r\npublic class Person {\r\n    @NotEmpty(groups = TestValidated.class)\r\n    private String name;\r\n    private String email;\r\n}\r\n\r\npublic class HelloWorldApplication extends Application<HelloWorldConfiguration>{\r\n\r\n @Override\r\n    public void run(HelloWorldConfiguration configuration,\r\n            Environment environment) {\r\n        environment.jersey().register(new HelloWorldResource());\r\n        environment.jersey().register(new ValidationExceptionMapper());\r\n        environment.jersey().enable(\r\n                \"jersey.config.beanValidation.enableOutputValidationErrorEntity.server\");\r\n    }\r\n\r\n@Path(\"/hello\")\r\n@Produces(MediaType.APPLICATION_JSON)\r\npublic class HelloWorldResource {\r\n    @POST\r\n    public Person sayHello(@Validated @NotNull Person person) {\r\n        String name = person.getName(); // get a NPE\r\n        return new Person(\"test\", \"test@test.com\");\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/comments/300038933","html_url":"https://github.com/dropwizard/dropwizard/issues/2049#issuecomment-300038933","issue_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/2049","id":300038933,"user":{"login":"nickbabcock","id":2106129,"avatar_url":"https://avatars2.githubusercontent.com/u/2106129?v=3","gravatar_id":"","url":"https://api.github.com/users/nickbabcock","html_url":"https://github.com/nickbabcock","followers_url":"https://api.github.com/users/nickbabcock/followers","following_url":"https://api.github.com/users/nickbabcock/following{/other_user}","gists_url":"https://api.github.com/users/nickbabcock/gists{/gist_id}","starred_url":"https://api.github.com/users/nickbabcock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickbabcock/subscriptions","organizations_url":"https://api.github.com/users/nickbabcock/orgs","repos_url":"https://api.github.com/users/nickbabcock/repos","events_url":"https://api.github.com/users/nickbabcock/events{/privacy}","received_events_url":"https://api.github.com/users/nickbabcock/received_events","type":"User","site_admin":false},"created_at":"2017-05-09T01:51:58Z","updated_at":"2017-05-09T01:51:58Z","body":"All usages of `@Validated` must be accompanied by the corresponding `@Valid` annotation."}}
{"actor":{"display_login":"nickbabcock"}}