{"action":"opened","issue":{"url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/issues/47","repository_url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues","labels_url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/issues/47/comments","events_url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/issues/47/events","html_url":"https://github.com/VasiliyLysokobylko/raml-js-parser2-issues/issues/47","id":146541666,"number":47,"title":"Simplify and add example for the behaviour when resource types and traits are getting merged","user":{"login":"VasiliyLysokobylko","id":13314242,"avatar_url":"https://avatars.githubusercontent.com/u/13314242?v=3","gravatar_id":"","url":"https://api.github.com/users/VasiliyLysokobylko","html_url":"https://github.com/VasiliyLysokobylko","followers_url":"https://api.github.com/users/VasiliyLysokobylko/followers","following_url":"https://api.github.com/users/VasiliyLysokobylko/following{/other_user}","gists_url":"https://api.github.com/users/VasiliyLysokobylko/gists{/gist_id}","starred_url":"https://api.github.com/users/VasiliyLysokobylko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/VasiliyLysokobylko/subscriptions","organizations_url":"https://api.github.com/users/VasiliyLysokobylko/orgs","repos_url":"https://api.github.com/users/VasiliyLysokobylko/repos","events_url":"https://api.github.com/users/VasiliyLysokobylko/events{/privacy}","received_events_url":"https://api.github.com/users/VasiliyLysokobylko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/labels/closed","name":"closed","color":"ededed"},{"url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/labels/content","name":"content","color":"ededed"},{"url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/labels/raml10-rc2","name":"raml10-rc2","color":"ededed"},{"url":"https://api.github.com/repos/VasiliyLysokobylko/raml-js-parser2-issues/labels/spec-consistency","name":"spec-consistency","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-07T08:11:28Z","updated_at":"2016-04-07T08:11:28Z","closed_at":null,"body":"Currently, RC1 defines a merging algorithm that helps people to understand how the merging of traits (and similar for resource types) works. In RC2 we should simplify that a bit more and add an example like the following:\r\n\r\n```yaml\r\nresourceTypes:\r\n  collection:\r\n    get:\r\n      description: just a test\r\n      headers:\r\n        APIKey:\r\n/resource:\r\n  type: collection\r\n  get:\r\n    description: override the description\r\n    responses:\r\n      200:\r\n        body:\r\n          application/json:\r\n```\r\n\r\nThe only overlay between the `collection` resource type and the resource declaration is `description` which is defined in both. In this example, the final version will have the description that has been explicitly defined in the resource. \r\n\r\nEvery explicit node will win over the ones that are declared in a resource type or trait. The rest get's simple merged. The final merged result must be:\r\n\r\n```yaml\r\n/resource:\r\n  get:\r\n    headers:\r\n      APIKey:\r\n    description: override the description\r\n    responses:\r\n      200:\r\n        body:\r\n          application/json:\r\n```"}}