{"action":"created","issue":{"url":"https://api.github.com/repos/mvc-spec/ozark/issues/109","repository_url":"https://api.github.com/repos/mvc-spec/ozark","labels_url":"https://api.github.com/repos/mvc-spec/ozark/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/mvc-spec/ozark/issues/109/comments","events_url":"https://api.github.com/repos/mvc-spec/ozark/issues/109/events","html_url":"https://github.com/mvc-spec/ozark/pull/109","id":235068690,"number":109,"title":"Replaced Jersey-dependent BindingInterceptorImpl by CDI ValidationInterceptor","user":{"login":"dmaidaniuk","id":12764116,"avatar_url":"https://avatars1.githubusercontent.com/u/12764116?v=3","gravatar_id":"","url":"https://api.github.com/users/dmaidaniuk","html_url":"https://github.com/dmaidaniuk","followers_url":"https://api.github.com/users/dmaidaniuk/followers","following_url":"https://api.github.com/users/dmaidaniuk/following{/other_user}","gists_url":"https://api.github.com/users/dmaidaniuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmaidaniuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmaidaniuk/subscriptions","organizations_url":"https://api.github.com/users/dmaidaniuk/orgs","repos_url":"https://api.github.com/users/dmaidaniuk/repos","events_url":"https://api.github.com/users/dmaidaniuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmaidaniuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-11T14:20:43Z","updated_at":"2017-06-13T05:26:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mvc-spec/ozark/pulls/109","html_url":"https://github.com/mvc-spec/ozark/pull/109","diff_url":"https://github.com/mvc-spec/ozark/pull/109.diff","patch_url":"https://github.com/mvc-spec/ozark/pull/109.patch"},"body":"Pull request relates to this discussion on the mailing list:\r\n\r\nhttps://groups.google.com/forum/#!topic/ozark-dev/pYw5u8VacnA\r\n\r\nThis PR will allow drop dependency to `org.glassfish.jersey.server.spi.ValidationInterceptor` and apply validation of resources in vendor-independent manner basing on CDI interceptor."},"comment":{"url":"https://api.github.com/repos/mvc-spec/ozark/issues/comments/308010290","html_url":"https://github.com/mvc-spec/ozark/pull/109#issuecomment-308010290","issue_url":"https://api.github.com/repos/mvc-spec/ozark/issues/109","id":308010290,"user":{"login":"dmaidaniuk","id":12764116,"avatar_url":"https://avatars1.githubusercontent.com/u/12764116?v=3","gravatar_id":"","url":"https://api.github.com/users/dmaidaniuk","html_url":"https://github.com/dmaidaniuk","followers_url":"https://api.github.com/users/dmaidaniuk/followers","following_url":"https://api.github.com/users/dmaidaniuk/following{/other_user}","gists_url":"https://api.github.com/users/dmaidaniuk/gists{/gist_id}","starred_url":"https://api.github.com/users/dmaidaniuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmaidaniuk/subscriptions","organizations_url":"https://api.github.com/users/dmaidaniuk/orgs","repos_url":"https://api.github.com/users/dmaidaniuk/repos","events_url":"https://api.github.com/users/dmaidaniuk/events{/privacy}","received_events_url":"https://api.github.com/users/dmaidaniuk/received_events","type":"User","site_admin":false},"created_at":"2017-06-13T05:26:04Z","updated_at":"2017-06-13T05:26:04Z","body":"@chkal It looks like in Jersey exists a bug with processing `@ValidateOnExecution` annotation properly. In `FormController` used for `org.glassfish.ozark.test.validation.ValidationIT` we have next code snippet:\r\n```\r\n    @POST\r\n    @Controller\r\n    @ValidateOnExecution(type = ExecutableType.NONE)\r\n    public Response formPost(@Valid @BeanParam FormDataBean form) {\r\n        if (br.isFailed()) {\r\n            ValidationError validationError = br.getAllValidationErrors().iterator().next();\r\n            final ConstraintViolation<?> cv = validationError.getViolation();\r\n            final String property = cv.getPropertyPath().toString();\r\n            error.setProperty(property.substring(property.lastIndexOf('.') + 1));\r\n            error.setValue(cv.getInvalidValue());\r\n            error.setMessage(cv.getMessage());\r\n            error.setParam(validationError.getParamName());\r\n            return Response.status(BAD_REQUEST).entity(\"error.jsp\").build();\r\n        }\r\n        return Response.status(OK).entity(\"data.jsp\").build();\r\n    }\r\n```\r\nThus according to [Bean Validation 1.1 documentation](http://beanvalidation.org/1.1/spec/#integration-general-executable) given method shouldn't be validated by Jersey's internal validation mechanism. Same statement present also in [Jersey's own documentation](https://jersey.github.io/documentation/latest/user-guide.html#bv.ValidateOnExecution).\r\n\r\nHowever annotation `@ValidateOnExecution(type = ExecutableType.NONE)` ignored by Jersey and HTTP code 404 returned to client in case with not valid data set in form, which is wrong. I will double-check my assumption and register bug-report for this in Jersey bug-tracker.\r\n\r\nMeanwhile I will search for workaround to catch this bug and fix it in Ozark.\r\n\r\n*Note:* I also verified given case with other JAX-RS implementation - RESTEasy. And it works properly by just skipping validation stage in such situation."}}
{"actor":{"display_login":"dmaidaniuk"}}