{"action":"created","issue":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/378","repository_url":"https://api.github.com/repos/raml-org/raml-spec","labels_url":"https://api.github.com/repos/raml-org/raml-spec/issues/378/labels{/name}","comments_url":"https://api.github.com/repos/raml-org/raml-spec/issues/378/comments","events_url":"https://api.github.com/repos/raml-org/raml-spec/issues/378/events","html_url":"https://github.com/raml-org/raml-spec/issues/378","id":147612347,"number":378,"title":"Clarify validate inner elements of JSON Schema","user":{"login":"fededonna","id":1690404,"avatar_url":"https://avatars.githubusercontent.com/u/1690404?v=3","gravatar_id":"","url":"https://api.github.com/users/fededonna","html_url":"https://github.com/fededonna","followers_url":"https://api.github.com/users/fededonna/followers","following_url":"https://api.github.com/users/fededonna/following{/other_user}","gists_url":"https://api.github.com/users/fededonna/gists{/gist_id}","starred_url":"https://api.github.com/users/fededonna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fededonna/subscriptions","organizations_url":"https://api.github.com/users/fededonna/orgs","repos_url":"https://api.github.com/users/fededonna/repos","events_url":"https://api.github.com/users/fededonna/events{/privacy}","received_events_url":"https://api.github.com/users/fededonna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-12T02:24:37Z","updated_at":"2016-04-12T12:08:41Z","closed_at":null,"body":"According to the following JSON Schema\r\n\r\n```json\r\n{\r\n    \"id\": \"http://some.site.somewhere/entry-schema#\",\r\n    \"$schema\": \"http://json-schema.org/draft-04/schema#\",\r\n    \"description\": \"schema for an animal or a person\",\r\n    \"type\": \"object\",\r\n    \"oneOf\": [\r\n       { \"$ref\": \"#/definitions/Person\" },\r\n       { \"$ref\": \"#/definitions/Animal\" }\r\n    ], \r\n    \"definitions\": {\r\n        \"Person\": {\r\n            \"type\": \"object\",\r\n            \"properties\":{\r\n              \"name\": {\r\n                \"type\": \"string\"\r\n              }\r\n            },\r\n            \"required\":[\"name\"]\r\n        },\r\n        \"Animal\": {\r\n            \"type\": \"object\",\r\n            \"properties\":{\r\n              \"specie\": {\r\n                  \"type\":\"string\"\r\n              }\r\n            },\r\n            \"required\": [\"specie\"]\r\n            \r\n        }\r\n    }\r\n}\r\n```\r\n\r\nThe allowed valid elements are **Animal** and **Person** so the following JSONs are valid:\r\n\r\n```json\r\n{\r\n\t\"specie\": \"Lion\"\r\n}\r\n```\r\n\r\n```json\r\n{\r\n    \"name\": \"John Doe\"\r\n}    \r\n```\r\n\r\nSo we can reference types as:\r\n\r\n``` yaml\r\ntype: Animal\r\nschema: !include type-library.json#Animal\r\n```\r\n\r\n``` yaml\r\ntype: Person\r\nschema: !include type-library.json#Person\r\n```\r\n\r\nBut you are not allowed to validate inner elements as:\r\n\r\n``` yaml\r\ntype: specie\r\nschema: !include type-library.json#specie\r\n```\r\n\r\n\r\nIs this assumption correct? This can not be validated because it can be an inner type and reference to siblings and the extraction of this is not possible without transforming the JSON in a weird way.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/raml-org/raml-spec/issues/comments/208872308","html_url":"https://github.com/raml-org/raml-spec/issues/378#issuecomment-208872308","issue_url":"https://api.github.com/repos/raml-org/raml-spec/issues/378","id":208872308,"user":{"login":"sichvoge","id":498114,"avatar_url":"https://avatars.githubusercontent.com/u/498114?v=3","gravatar_id":"","url":"https://api.github.com/users/sichvoge","html_url":"https://github.com/sichvoge","followers_url":"https://api.github.com/users/sichvoge/followers","following_url":"https://api.github.com/users/sichvoge/following{/other_user}","gists_url":"https://api.github.com/users/sichvoge/gists{/gist_id}","starred_url":"https://api.github.com/users/sichvoge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sichvoge/subscriptions","organizations_url":"https://api.github.com/users/sichvoge/orgs","repos_url":"https://api.github.com/users/sichvoge/repos","events_url":"https://api.github.com/users/sichvoge/events{/privacy}","received_events_url":"https://api.github.com/users/sichvoge/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T12:08:41Z","updated_at":"2016-04-12T12:08:41Z","body":"@fededonna does all this relate to issues #377 & #379? And are your main concerns in the end not the same?"}}