{"action":"created","issue":{"url":"https://api.github.com/repos/mulesoft-labs/raml-generator/issues/6","labels_url":"https://api.github.com/repos/mulesoft-labs/raml-generator/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mulesoft-labs/raml-generator/issues/6/comments","events_url":"https://api.github.com/repos/mulesoft-labs/raml-generator/issues/6/events","html_url":"https://github.com/mulesoft-labs/raml-generator/issues/6","id":67242924,"number":6,"title":"Include Schemas in raml context","user":{"login":"justjacksonn","id":10764578,"avatar_url":"https://avatars.githubusercontent.com/u/10764578?v=3","gravatar_id":"","url":"https://api.github.com/users/justjacksonn","html_url":"https://github.com/justjacksonn","followers_url":"https://api.github.com/users/justjacksonn/followers","following_url":"https://api.github.com/users/justjacksonn/following{/other_user}","gists_url":"https://api.github.com/users/justjacksonn/gists{/gist_id}","starred_url":"https://api.github.com/users/justjacksonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjacksonn/subscriptions","organizations_url":"https://api.github.com/users/justjacksonn/orgs","repos_url":"https://api.github.com/users/justjacksonn/repos","events_url":"https://api.github.com/users/justjacksonn/events{/privacy}","received_events_url":"https://api.github.com/users/justjacksonn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-08T23:30:09Z","updated_at":"2015-04-10T18:40:11Z","closed_at":null,"body":"Currently, the schemas defined in the root of a raml file, as well as schemas embedded within the raml file are not accessible in any way via the raml context object.\r\n\r\nIt would be ideal to have a allSchemas (like allResources) option that would be a flat list of all schema files. This should be some form of object though.. because in some cases the schemas are include files, and in others they are inlined. I'd argue against loading up all the include schemas into memory and work towards not using inlined schemas at all, but it is what it is now, so I'd urge that we keep the flat list that includes the type (inline or file) and the actual value (the path/file, or the string of inlined schema). \r\n\r\nThen perhaps for each resource, we have the schema option so that as we iterate a resource, we can access the schema if need be (maybe this is there now? I haven't looked to see if that is possible).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mulesoft-labs/raml-generator/issues/comments/91647942","html_url":"https://github.com/mulesoft-labs/raml-generator/issues/6#issuecomment-91647942","issue_url":"https://api.github.com/repos/mulesoft-labs/raml-generator/issues/6","id":91647942,"user":{"login":"justjacksonn","id":10764578,"avatar_url":"https://avatars.githubusercontent.com/u/10764578?v=3","gravatar_id":"","url":"https://api.github.com/users/justjacksonn","html_url":"https://github.com/justjacksonn","followers_url":"https://api.github.com/users/justjacksonn/followers","following_url":"https://api.github.com/users/justjacksonn/following{/other_user}","gists_url":"https://api.github.com/users/justjacksonn/gists{/gist_id}","starred_url":"https://api.github.com/users/justjacksonn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justjacksonn/subscriptions","organizations_url":"https://api.github.com/users/justjacksonn/orgs","repos_url":"https://api.github.com/users/justjacksonn/repos","events_url":"https://api.github.com/users/justjacksonn/events{/privacy}","received_events_url":"https://api.github.com/users/justjacksonn/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T18:40:11Z","updated_at":"2015-04-10T18:40:11Z","body":"So I'll add to this after talking with Blake a bit on gitter yesterday.\nEach of the resource methods/bodies have the schemas loaded as a String.\nSo, correct me if I am wrong Blake, but in the case of an alias used in a\nbody schema section, I think the string of the schema is loaded up at that\npoint, such that resource.methods.post.body.mediatype.schema is a string of\nthe json schema (or xsd) and not just the name (alias) that is used. So I\nassume in the code Blake actually looks up the alias name, and loads the\nschema at that point.\n\n\nOn Wed, Apr 8, 2015 at 11:53 PM, Christian Vogel <notifications@github.com>\nwrote:\n\n> @blakeembrey <https://github.com/blakeembrey>, first the allSchemas\n> should be on the context level and second, you can give an id or name\n> into your json schema you can use, for example, and in XSDs it is name. So\n> that should work, right? How do you store the schemas? Is it just the pure\n> string or json object or ...?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/mulesoft-labs/raml-generator/issues/6#issuecomment-91130114>\n> .\n>\n"}}