{"action":"created","issue":{"url":"https://api.github.com/repos/spotify/ramlfications/issues/23","labels_url":"https://api.github.com/repos/spotify/ramlfications/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/spotify/ramlfications/issues/23/comments","events_url":"https://api.github.com/repos/spotify/ramlfications/issues/23/events","html_url":"https://github.com/spotify/ramlfications/issues/23","id":96081520,"number":23,"title":"How to inherit resourceTypes by resource?","user":{"login":"postatum","id":1999863,"avatar_url":"https://avatars.githubusercontent.com/u/1999863?v=3","gravatar_id":"","url":"https://api.github.com/users/postatum","html_url":"https://github.com/postatum","followers_url":"https://api.github.com/users/postatum/followers","following_url":"https://api.github.com/users/postatum/following{/other_user}","gists_url":"https://api.github.com/users/postatum/gists{/gist_id}","starred_url":"https://api.github.com/users/postatum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/postatum/subscriptions","organizations_url":"https://api.github.com/users/postatum/orgs","repos_url":"https://api.github.com/users/postatum/repos","events_url":"https://api.github.com/users/postatum/events{/privacy}","received_events_url":"https://api.github.com/users/postatum/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spotify/ramlfications/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/spotify/ramlfications/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"econchick","id":1191069,"avatar_url":"https://avatars.githubusercontent.com/u/1191069?v=3","gravatar_id":"","url":"https://api.github.com/users/econchick","html_url":"https://github.com/econchick","followers_url":"https://api.github.com/users/econchick/followers","following_url":"https://api.github.com/users/econchick/following{/other_user}","gists_url":"https://api.github.com/users/econchick/gists{/gist_id}","starred_url":"https://api.github.com/users/econchick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/econchick/subscriptions","organizations_url":"https://api.github.com/users/econchick/orgs","repos_url":"https://api.github.com/users/econchick/repos","events_url":"https://api.github.com/users/econchick/events{/privacy}","received_events_url":"https://api.github.com/users/econchick/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/spotify/ramlfications/milestones/3","html_url":"https://github.com/spotify/ramlfications/milestones/0.1.9%20release","labels_url":"https://api.github.com/repos/spotify/ramlfications/milestones/3/labels","id":1343434,"number":3,"title":"0.1.9 release","description":"","creator":{"login":"econchick","id":1191069,"avatar_url":"https://avatars.githubusercontent.com/u/1191069?v=3","gravatar_id":"","url":"https://api.github.com/users/econchick","html_url":"https://github.com/econchick","followers_url":"https://api.github.com/users/econchick/followers","following_url":"https://api.github.com/users/econchick/following{/other_user}","gists_url":"https://api.github.com/users/econchick/gists{/gist_id}","starred_url":"https://api.github.com/users/econchick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/econchick/subscriptions","organizations_url":"https://api.github.com/users/econchick/orgs","repos_url":"https://api.github.com/users/econchick/repos","events_url":"https://api.github.com/users/econchick/events{/privacy}","received_events_url":"https://api.github.com/users/econchick/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2015-10-07T20:37:12Z","updated_at":"2015-10-08T20:04:40Z","due_on":"2015-10-23T07:00:00Z","closed_at":null},"comments":8,"created_at":"2015-07-20T14:50:09Z","updated_at":"2015-11-03T13:07:35Z","closed_at":null,"body":"Hi guys.\r\nFirst of all, thanks a lot for all you work. Enjoying your parser a lot so far.\r\n\r\nWhen working with resourceTypes I've faced an issue: How do I make resource inherit from one of resourceTypes properly in ramlfications?\r\n\r\n[Docs section says](https://ramlfications.readthedocs.org/en/latest/extendedusage.html#mapping-of-properties-and-elements-from-traits-resource-types-to-resources) that \r\n> When a resource has a trait and/or type assigned to it, or a resource type has another resource type or a trait assigned to it, it inherits its properties.\r\n\r\nI have following RAML file:\r\n\r\n```\r\n#%RAML 0.8\r\n---\r\ntitle: Example REST API\r\ndocumentation:\r\n    - title: Home\r\n      content: Welcome to the example API.\r\nbaseUri: http://example.com\r\nversion: v1\r\nresourceTypes:\r\n    - collection:\r\n        description: The collection of items\r\n        get:\r\n            description: Get all items, optionally filtered\r\n        post:\r\n            description: Create a new items object\r\n\r\n/items:\r\n    type: collection\r\n```\r\n\r\nWhat I expect after parsing this file is:\r\n* 1 /items resource with method GET\r\n* 1 /items resource with method POST\r\n* Both resources having proper descriptions\r\n* /items resources having proper resource description (The collection of items)\r\n\r\nBut when I parse it and check results in console, that's what I see:\r\n\r\n```\r\nIn [1]: import ramlfications\r\n\r\nIn [2]: api = ramlfications.parse('example.raml')\r\n\r\nIn [3]: api.resources\r\nOut[3]: [ResourceNode(method=None, path='/items')]\r\n\r\nIn [4]: resource = api.resources[0]\r\n\r\nIn [5]: resource.description\r\nOut[5]: ---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n.......\r\nTypeError: __repr__ returned non-string (type NoneType)\r\n```\r\n\r\nI tried defining methods on /items route as follows and was hoping inheritance will have this way but had no luck again.\r\n```\r\n...\r\n/items:\r\n    type: collection\r\n    get:\r\n    post:\r\n```\r\n\r\nPlease give an advice on what is the correct way to achieve what I want using ramlfications?\r\n\r\nThanks for your time! :)"},"comment":{"url":"https://api.github.com/repos/spotify/ramlfications/issues/comments/153347108","html_url":"https://github.com/spotify/ramlfications/issues/23#issuecomment-153347108","issue_url":"https://api.github.com/repos/spotify/ramlfications/issues/23","id":153347108,"user":{"login":"econchick","id":1191069,"avatar_url":"https://avatars.githubusercontent.com/u/1191069?v=3","gravatar_id":"","url":"https://api.github.com/users/econchick","html_url":"https://github.com/econchick","followers_url":"https://api.github.com/users/econchick/followers","following_url":"https://api.github.com/users/econchick/following{/other_user}","gists_url":"https://api.github.com/users/econchick/gists{/gist_id}","starred_url":"https://api.github.com/users/econchick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/econchick/subscriptions","organizations_url":"https://api.github.com/users/econchick/orgs","repos_url":"https://api.github.com/users/econchick/repos","events_url":"https://api.github.com/users/econchick/events{/privacy}","received_events_url":"https://api.github.com/users/econchick/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T13:07:35Z","updated_at":"2015-11-03T13:07:35Z","body":"@postatum I just re-read the RAML spec, and if I understand correctly, I think `/stories/{id}` and `/users/{username}` should _not_ inherit resource types.  I'm particularly looking at this line under [Resource Types and Traits](http://raml.org/spec.html#resource-types-and-traits):\r\n\r\n> Resource type definitions MUST NOT incorporate nested resources; they cannot be used to generate nested resources when they are applied to a resource, and they do not apply to its existing nested resources.\r\n\r\nDo you think it should be otherwise?"}}