{"action":"created","issue":{"url":"https://api.github.com/repos/arineng/jcrvalidator/issues/88","repository_url":"https://api.github.com/repos/arineng/jcrvalidator","labels_url":"https://api.github.com/repos/arineng/jcrvalidator/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/arineng/jcrvalidator/issues/88/comments","events_url":"https://api.github.com/repos/arineng/jcrvalidator/issues/88/events","html_url":"https://github.com/arineng/jcrvalidator/issues/88","id":173403570,"number":88,"title":"Object validation torture","user":{"login":"codalogic","id":1752198,"avatar_url":"https://avatars.githubusercontent.com/u/1752198?v=3","gravatar_id":"","url":"https://api.github.com/users/codalogic","html_url":"https://github.com/codalogic","followers_url":"https://api.github.com/users/codalogic/followers","following_url":"https://api.github.com/users/codalogic/following{/other_user}","gists_url":"https://api.github.com/users/codalogic/gists{/gist_id}","starred_url":"https://api.github.com/users/codalogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalogic/subscriptions","organizations_url":"https://api.github.com/users/codalogic/orgs","repos_url":"https://api.github.com/users/codalogic/repos","events_url":"https://api.github.com/users/codalogic/events{/privacy}","received_events_url":"https://api.github.com/users/codalogic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":35,"created_at":"2016-08-26T08:57:35Z","updated_at":"2016-09-08T10:23:55Z","closed_at":null,"body":"I've been thinking about validation of objects.  If we have the following JCR:\r\n\r\n    { \"bar\":string, ( \"foo\":integer | \"baz\":string ) }\r\n\r\nshould the following JSON be valid or not:\r\n\r\n    { \"bar\":\"thing\", \"foo\":2, \"baz\": \"thingy\" }\r\n\r\nMy feeling is not because the author is saying they want one or the other.\r\n\r\nWhat do others expect?"},"comment":{"url":"https://api.github.com/repos/arineng/jcrvalidator/issues/comments/245556442","html_url":"https://github.com/arineng/jcrvalidator/issues/88#issuecomment-245556442","issue_url":"https://api.github.com/repos/arineng/jcrvalidator/issues/88","id":245556442,"user":{"login":"codalogic","id":1752198,"avatar_url":"https://avatars.githubusercontent.com/u/1752198?v=3","gravatar_id":"","url":"https://api.github.com/users/codalogic","html_url":"https://github.com/codalogic","followers_url":"https://api.github.com/users/codalogic/followers","following_url":"https://api.github.com/users/codalogic/following{/other_user}","gists_url":"https://api.github.com/users/codalogic/gists{/gist_id}","starred_url":"https://api.github.com/users/codalogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codalogic/subscriptions","organizations_url":"https://api.github.com/users/codalogic/orgs","repos_url":"https://api.github.com/users/codalogic/repos","events_url":"https://api.github.com/users/codalogic/events{/privacy}","received_events_url":"https://api.github.com/users/codalogic/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T10:23:55Z","updated_at":"2016-09-08T10:23:55Z","body":"I think it's appropriate to differentiate between 'casual' users and implementers.  The story you tell each one can be slightly different.\r\n\r\nSo for users you can say something like:\r\n\r\n--------\r\nThe `|` symbol represents a choice.  If the solution space of the expressions in the left and right branches do not overlap (see below), then only the left or the right, but not both, branch can be true.  For example, given the choice:\r\n\r\n    { \"a\":int8 | \"b\":int8 }\r\n\r\nthen the following JSON instances are valid:\r\n\r\n    { \"a\" : 1 }\r\n    { \"b\" : 1 }\r\n\r\nThe following is invalid:\r\n\r\n    { \"a\" : 1, \"b\" : 1 }\r\n\r\nFor a rule where the solution space of the branches do overlap, e.g:\r\n\r\n    { ( \"a\":int8, \"b\":int8 ?) | (\"a\":int8 ?, \"b\": int8) }\r\n\r\nthen the following JSON instances are valid:\r\n\r\n    { \"a\":1 }\r\n    { \"b\":1 }\r\n    { \"a\":1, \"b\":1 }\r\n\r\nNote that in the case of `{ \"a\":1, \"b\":1 }` both branches are true and as such, the solution space is said to overlap.  Appendix ??? describes a reference algorithm for how to implement this behavior.\r\n\r\n--------\r\n\r\nThen in Appendix ??? we go into the detail of augmentation etc.\r\n\r\nRegardless of what solution we adopt I think we should describe it as above.  The casual user can then just rely on the examples, and draw on their experiences of regular expressions, XML schema, whatever.  Only if they get a result they don't expect would they have to delve into the logic of the reference implementation.  The less likely they are to get a surprising result, the less likely they are going to need to look into the detail."}}
{"actor":{"display_login":"codalogic"}}