{"action":"created","issue":{"url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/issues/21","labels_url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/issues/21/comments","events_url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/issues/21/events","html_url":"https://github.com/beanvalidation/beanvalidation.org/pull/21","id":129506811,"number":21,"title":"BVAL-214 Ability to validate an object and a list of changes - Initial proposal","user":{"login":"gunnarmorling","id":28612,"avatar_url":"https://avatars.githubusercontent.com/u/28612?v=3","gravatar_id":"","url":"https://api.github.com/users/gunnarmorling","html_url":"https://github.com/gunnarmorling","followers_url":"https://api.github.com/users/gunnarmorling/followers","following_url":"https://api.github.com/users/gunnarmorling/following{/other_user}","gists_url":"https://api.github.com/users/gunnarmorling/gists{/gist_id}","starred_url":"https://api.github.com/users/gunnarmorling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunnarmorling/subscriptions","organizations_url":"https://api.github.com/users/gunnarmorling/orgs","repos_url":"https://api.github.com/users/gunnarmorling/repos","events_url":"https://api.github.com/users/gunnarmorling/events{/privacy}","received_events_url":"https://api.github.com/users/gunnarmorling/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-01-28T16:44:00Z","updated_at":"2016-01-29T16:31:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/pulls/21","html_url":"https://github.com/beanvalidation/beanvalidation.org/pull/21","diff_url":"https://github.com/beanvalidation/beanvalidation.org/pull/21.diff","patch_url":"https://github.com/beanvalidation/beanvalidation.org/pull/21.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/issues/comments/176850112","html_url":"https://github.com/beanvalidation/beanvalidation.org/pull/21#issuecomment-176850112","issue_url":"https://api.github.com/repos/beanvalidation/beanvalidation.org/issues/21","id":176850112,"user":{"login":"gunnarmorling","id":28612,"avatar_url":"https://avatars.githubusercontent.com/u/28612?v=3","gravatar_id":"","url":"https://api.github.com/users/gunnarmorling","html_url":"https://github.com/gunnarmorling","followers_url":"https://api.github.com/users/gunnarmorling/followers","following_url":"https://api.github.com/users/gunnarmorling/following{/other_user}","gists_url":"https://api.github.com/users/gunnarmorling/gists{/gist_id}","starred_url":"https://api.github.com/users/gunnarmorling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gunnarmorling/subscriptions","organizations_url":"https://api.github.com/users/gunnarmorling/orgs","repos_url":"https://api.github.com/users/gunnarmorling/repos","events_url":"https://api.github.com/users/gunnarmorling/events{/privacy}","received_events_url":"https://api.github.com/users/gunnarmorling/received_events","type":"User","site_admin":false},"created_at":"2016-01-29T16:31:34Z","updated_at":"2016-01-29T16:31:34Z","body":"> To solve JSF and generally UI framework issues, an alternative solution is to invent a new form of class level constraint contract that would not give you the raw object but rather a detyped version of it.\r\n\r\nUff, that seems super-heavy on constraint authors.\r\n\r\n> . But to be honest these are explicitly custom constraints and people know that they plan on using JSF and co. \r\n\r\nYes, but it's just so much code to write. People dislike class-level constraints for that anyways, and I think that'd make it worse.\r\n\r\nIMHO, if we decide to open up the constraint validator concept for evolution, I'd rather re-visit the approach for cross-field constraints in a more generic sense, e.g. like so:\r\n\r\n    public class UserDataBean {\r\n        String name;\r\n\r\n        String password;\r\n\r\n        @Equals(\"$bean.password\")\r\n        String passwordRepeat;\r\n    }\r\n\r\n    public class EqualsValidator implements ConstraintValidator<Equals, String> {\r\n        String compareTo;\r\n\r\n        void initialize(Equals annotation) {\r\n            this.compareTo = annotation.value();\r\n        }\r\n\r\n        boolean isValid(String value, ConstraintValidatorContext ctx) {\r\n            String comparedValue = ctx.getBeanProperties().getCompareTo();\r\n            return value.equals( comparedValue );\r\n        }\r\n    }\r\n\r\nIn that case we could easily implement the proposed `validateValues()` API by passing the values from the given map into the validator via `ConstraintValidatorContext#getBeanProperties()`.\r\n\r\n@emmanuelbernard, I think there was a reason for you to be against this, but it'd seem very helpful for the issue at bay."}}