{"action":"opened","issue":{"url":"https://api.github.com/repos/apiaryio/api-blueprint/issues/284","labels_url":"https://api.github.com/repos/apiaryio/api-blueprint/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/apiaryio/api-blueprint/issues/284/comments","events_url":"https://api.github.com/repos/apiaryio/api-blueprint/issues/284/events","html_url":"https://github.com/apiaryio/api-blueprint/issues/284","id":116513809,"number":284,"title":"Extending Data Structures","user":{"login":"robbinjanssen","id":120077,"avatar_url":"https://avatars.githubusercontent.com/u/120077?v=3","gravatar_id":"","url":"https://api.github.com/users/robbinjanssen","html_url":"https://github.com/robbinjanssen","followers_url":"https://api.github.com/users/robbinjanssen/followers","following_url":"https://api.github.com/users/robbinjanssen/following{/other_user}","gists_url":"https://api.github.com/users/robbinjanssen/gists{/gist_id}","starred_url":"https://api.github.com/users/robbinjanssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbinjanssen/subscriptions","organizations_url":"https://api.github.com/users/robbinjanssen/orgs","repos_url":"https://api.github.com/users/robbinjanssen/repos","events_url":"https://api.github.com/users/robbinjanssen/events{/privacy}","received_events_url":"https://api.github.com/users/robbinjanssen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-12T09:44:52Z","updated_at":"2015-11-12T09:44:52Z","closed_at":null,"body":"Hi, I've got a question/proposal about data structures. Maybe this is more MSON related but I'll start here. To keep data structures nice and tidy, i'd like as little duplicate data as possible, therefor it would be nice if data structures could extend each other.\r\n\r\nAssume the following data structure:\r\n\r\n```apib\r\n# Data Structures\r\n\r\n## Project_Link (object) \r\n+ self: `https://test.api.com/projects/5` (string, required)\r\n\r\n## Project1_Get (object)\r\n+ type: `projects` (string, required)\r\n+ id: `5` (string, required)\r\n+ attributes (object, required)\r\n    + number: `PRO-5` (string) - A readable identifier for employees to refer to projects.\r\n+ links (Project_Link, required)\r\n```\r\n\r\nIn the `links` attribute of `Project1_Get` I re-use the `Project_Link` object which works great. But suppose I need the following DataStructure as well:\r\n\r\n```apib\r\n## Project1_Identifier (object)\r\n+ type: `projects` (string, required)\r\n+ id: `5` (string, required)\r\n```\r\n\r\nNow there is duplicate data in my data structures because the `Project1_Identifier` contains the `type` and `id` attribute, but also the `Project1_Get` contains it. It would be great if I could do the following:\r\n\r\n```apib\r\n# Data Structures\r\n\r\n## Project1_Link (object) \r\n+ self: `https://test.api.com/projects/5` (string, required)\r\n\r\n## Project1_Identifier (object)\r\n+ type: `projects` (string, required)\r\n+ id: `5` (string, required)\r\n\r\n## Project1_Get (Project_Identifier) <--- Extend!\r\n+ attributes (object, required)\r\n    + number: `PRO-5` (string) - A readable identifier for employees to refer to projects.\r\n+ links (Project1_Link, required)\r\n```\r\n\r\nIn the following example drafter returns errors:\r\n```apib\r\nFORMAT: 1A\r\nHOST: https://test.api.com/\r\n\r\n# Test API\r\nHi, welcome to the API!\r\n\r\n# Group Projects\r\nWow, we are using projects!\r\n\r\n### Retrieve single project [GET /projects/{id}]\r\n+ Parameters\r\n    + id: `5` (string, required)\r\n\r\n+ Response 200 (application/json)\r\n    + Attributes (object)\r\n        + data (Project1_Get, required)\r\n\r\n# Data Structures\r\n\r\n## Project_Link (object) \r\n+ self: `https://test.api.com/projects/5` (string, required)\r\n\r\n## Project_Identifier (object)\r\n+ type: `projects` (string, required)\r\n+ id: `5` (string, required)\r\n\r\n## Project1_Get (Project_Identifier)\r\n+ type: `projects` (string, required)\r\n+ id: `5` (string, required)\r\n+ attributes (object, required)\r\n    + number: `PRO-5` (string) - A readable identifier for employees to refer to projects.\r\n+ links (Project_Link, required)\r\n```\r\n\r\n```\r\nuser@development:/srv/www/docs$ drafter -v\r\nv2.0.0-pre.1\r\nuser@development:/srv/www/docs$ drafter --validate docs.md --use-line-num\r\n\r\nerror: (4)  base type 'Project1_Get' is not defined in the document; line 16, column 11 - line 16, column 40\r\nwarning: (8)  unable to find the symbol `Project1_Get` in the list of named types; line 16, column 11 - line 16, column 40\r\n```\r\n\r\n\r\n"}}