{"action":"created","issue":{"url":"https://api.github.com/repos/osiam/osiam/issues/142","repository_url":"https://api.github.com/repos/osiam/osiam","labels_url":"https://api.github.com/repos/osiam/osiam/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/osiam/osiam/issues/142/comments","events_url":"https://api.github.com/repos/osiam/osiam/issues/142/events","html_url":"https://github.com/osiam/osiam/issues/142","id":134133308,"number":142,"title":"Validate schema of incoming resources","user":{"login":"wallner","id":563601,"avatar_url":"https://avatars.githubusercontent.com/u/563601?v=3","gravatar_id":"","url":"https://api.github.com/users/wallner","html_url":"https://github.com/wallner","followers_url":"https://api.github.com/users/wallner/followers","following_url":"https://api.github.com/users/wallner/following{/other_user}","gists_url":"https://api.github.com/users/wallner/gists{/gist_id}","starred_url":"https://api.github.com/users/wallner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallner/subscriptions","organizations_url":"https://api.github.com/users/wallner/orgs","repos_url":"https://api.github.com/users/wallner/repos","events_url":"https://api.github.com/users/wallner/events{/privacy}","received_events_url":"https://api.github.com/users/wallner/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/osiam/osiam/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/osiam/osiam/milestones/1","html_url":"https://github.com/osiam/osiam/milestones/v3.0","labels_url":"https://api.github.com/repos/osiam/osiam/milestones/1/labels","id":1250676,"number":1,"title":"v3.0","description":"OSIAM 3.0 will be completely overhauled providing a better experience in the following topics:\r\n\r\n* Operational support (Deployment, Configuration, Monitoring, etc.)\r\n* Ease of Usage\r\n* SCIM 2 compliance\r\n\r\nSee all associated issues and pull requests for more details.","creator":{"login":"tkrille","id":5213491,"avatar_url":"https://avatars.githubusercontent.com/u/5213491?v=3","gravatar_id":"","url":"https://api.github.com/users/tkrille","html_url":"https://github.com/tkrille","followers_url":"https://api.github.com/users/tkrille/followers","following_url":"https://api.github.com/users/tkrille/following{/other_user}","gists_url":"https://api.github.com/users/tkrille/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrille/subscriptions","organizations_url":"https://api.github.com/users/tkrille/orgs","repos_url":"https://api.github.com/users/tkrille/repos","events_url":"https://api.github.com/users/tkrille/events{/privacy}","received_events_url":"https://api.github.com/users/tkrille/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":21,"state":"open","created_at":"2015-08-11T20:36:51Z","updated_at":"2016-02-17T00:31:51Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2016-02-17T00:06:19Z","updated_at":"2016-02-17T08:19:35Z","closed_at":null,"body":"The merge of pr #134 disabled the validation of the schema resources. To be SCIM compliant we need to validate the schemas again."},"comment":{"url":"https://api.github.com/repos/osiam/osiam/issues/comments/185090722","html_url":"https://github.com/osiam/osiam/issues/142#issuecomment-185090722","issue_url":"https://api.github.com/repos/osiam/osiam/issues/142","id":185090722,"user":{"login":"tkrille","id":5213491,"avatar_url":"https://avatars.githubusercontent.com/u/5213491?v=3","gravatar_id":"","url":"https://api.github.com/users/tkrille","html_url":"https://github.com/tkrille","followers_url":"https://api.github.com/users/tkrille/followers","following_url":"https://api.github.com/users/tkrille/following{/other_user}","gists_url":"https://api.github.com/users/tkrille/gists{/gist_id}","starred_url":"https://api.github.com/users/tkrille/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tkrille/subscriptions","organizations_url":"https://api.github.com/users/tkrille/orgs","repos_url":"https://api.github.com/users/tkrille/repos","events_url":"https://api.github.com/users/tkrille/events{/privacy}","received_events_url":"https://api.github.com/users/tkrille/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T08:19:35Z","updated_at":"2016-02-17T08:19:35Z","body":"I would name the new abstract method `getCoreSchema()` to avoid confusion with `Resource#getSchemas()`. But why even add a new abstract method? We can also configure the schema to check on the annotation, like this:\r\n\r\n```java\r\n@ValidCoreSchema(User.SCHEMA)\r\npublic class User {\r\n    // ...\r\n}\r\n\r\n@Constraint(validatedBy = { ValidCoreSchemaValidator.class })\r\n// ...\r\npublic @interface ValidCoreSchema {\r\n    String value();\r\n    // ...\r\n}\r\n\r\npublic class ValidCoreSchemaValidator implements ConstraintValidator<ValidCoreSchema, Resource> {\r\n    // ... find ValidCoreSchema#value() in Resource#getSchemas() to validate the Resource\r\n}\r\n```\r\n\r\n(The names are just explanatory and not well-thought)"}}