{"action":"created","issue":{"url":"https://api.github.com/repos/apiaryio/mson/issues/23","labels_url":"https://api.github.com/repos/apiaryio/mson/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/apiaryio/mson/issues/23/comments","events_url":"https://api.github.com/repos/apiaryio/mson/issues/23/events","html_url":"https://github.com/apiaryio/mson/issues/23","id":78579936,"number":23,"title":"Behaviour when redefining attributes in Mixins","user":{"login":"neonichu","id":118992,"avatar_url":"https://avatars.githubusercontent.com/u/118992?v=3","gravatar_id":"","url":"https://api.github.com/users/neonichu","html_url":"https://github.com/neonichu","followers_url":"https://api.github.com/users/neonichu/followers","following_url":"https://api.github.com/users/neonichu/following{/other_user}","gists_url":"https://api.github.com/users/neonichu/gists{/gist_id}","starred_url":"https://api.github.com/users/neonichu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neonichu/subscriptions","organizations_url":"https://api.github.com/users/neonichu/orgs","repos_url":"https://api.github.com/users/neonichu/repos","events_url":"https://api.github.com/users/neonichu/events{/privacy}","received_events_url":"https://api.github.com/users/neonichu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-20T15:53:23Z","updated_at":"2015-05-22T05:46:04Z","closed_at":"2015-05-22T05:46:04Z","body":"Not sure if this is the right repo to talk about this, as it probably also relates to implementations. It seems like the behaviour when redefining attributes via Mixins is not defined at all. I have included the MSON I am talking about at the bottom of this to make it more readable.\r\n\r\nBasically, I have two mixins which define the same attribute and its value is an object. My naive expectation (or maybe hope) was that the two object values would get merged, so that I would have one JSON dictionaries with values and keys of both those objects in the resulting JSON representation. What actually happens is that the value from the second mixin overwrites the first.\r\n\r\nIs this considered to be the correct behaviour? If yes, is there a way to achieve the merging that I naively expected?\r\n\r\nMy MSON:\r\n\r\n```markdown\r\n### Content Type\r\n\r\n- sys\r\n    - type: ContentType - Type of Resource\r\n    - id: 3ORKIAOaJqQWWg86MWkyOs - Identifier\r\n    - version: 1 (number) - Version of Resource\r\n\r\n### Content Type Creation\r\n\r\n- name: Blog Post - Name of the Content Type\r\n- fields (array[object]) - Defined Fields\r\n    - (object)\r\n        - id: title - Identifier of the Field\r\n        - name: Title - Display name of the Field\r\n        - type: Text - Type of the Field\r\n    - (object)\r\n        - id: body - Identifier of the Field\r\n        - name: Body - Display name of the Field\r\n        - type: Text - Type of the Field\r\n\r\n### Content Type Published\r\n\r\n- Include Content Type Creation\r\n- Include Content Type\r\n- Include Resource Published\r\n\r\n### Resource Published\r\n\r\n- sys - System Attributes\r\n    - firstPublishedAt: `2015-05-15T13:38:11.311Z` - Date/time of first publishing\r\n    - publishedCounter: 2 (number) - Number of times published\r\n    - publishedAt: `2015-05-15T13:38:11.311Z` - Date/time of current publishing\r\n    - publishedBy (User B)\r\n    - publishedVersion: 9 (number) - Version of the resource that has been published\r\n```\r\n\r\nResulting JSON:\r\n\r\n```json\r\n{\r\n  \"name\": \"Blog Post\",\r\n  \"fields\": [\r\n    {\r\n      \"id\": \"title\",\r\n      \"name\": \"Title\",\r\n      \"type\": \"Text\"\r\n    },\r\n    {\r\n      \"id\": \"body\",\r\n      \"name\": \"Body\",\r\n      \"type\": \"Text\"\r\n    }\r\n  ],\r\n  \"sys\": {\r\n    \"firstPublishedAt\": \"2015-05-15T13:38:11.311Z\",\r\n    \"publishedCounter\": 2,\r\n    \"publishedAt\": \"2015-05-15T13:38:11.311Z\",\r\n    \"publishedBy\": {\r\n      \"sys\": {\r\n        \"type\": \"Link\",\r\n        \"linkType\": \"User\",\r\n        \"id\": \"4FLrUHftHW3v2BLi9fzfjU\"\r\n      }\r\n    },\r\n    \"publishedVersion\": 9\r\n  }\r\n}\r\n```\r\n\r\nDesired JSON:\r\n\r\n```json\r\n{\r\n  \"name\": \"Blog Post\",\r\n  \"fields\": [\r\n    {\r\n      \"id\": \"title\",\r\n      \"name\": \"Title\",\r\n      \"type\": \"Text\"\r\n    },\r\n    {\r\n      \"id\": \"body\",\r\n      \"name\": \"Body\",\r\n      \"type\": \"Text\"\r\n    }\r\n  ],\r\n  \"sys\": {\r\n    \"firstPublishedAt\": \"2015-05-15T13:38:11.311Z\",\r\n    \"publishedCounter\": 2,\r\n    \"publishedAt\": \"2015-05-15T13:38:11.311Z\",\r\n    \"publishedBy\": {\r\n      \"sys\": {\r\n        \"type\": \"Link\",\r\n        \"linkType\": \"User\",\r\n        \"id\": \"4FLrUHftHW3v2BLi9fzfjU\"\r\n      }\r\n    },\r\n    \"publishedVersion\": 9,\r\n    \"type\": \"ContentType\",\r\n    \"id\": \"3ORKIAOaJqQWWg86MWkyOs\",\r\n    \"version\": 1\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/apiaryio/mson/issues/comments/104520038","html_url":"https://github.com/apiaryio/mson/issues/23#issuecomment-104520038","issue_url":"https://api.github.com/repos/apiaryio/mson/issues/23","id":104520038,"user":{"login":"pksunkara","id":174703,"avatar_url":"https://avatars.githubusercontent.com/u/174703?v=3","gravatar_id":"","url":"https://api.github.com/users/pksunkara","html_url":"https://github.com/pksunkara","followers_url":"https://api.github.com/users/pksunkara/followers","following_url":"https://api.github.com/users/pksunkara/following{/other_user}","gists_url":"https://api.github.com/users/pksunkara/gists{/gist_id}","starred_url":"https://api.github.com/users/pksunkara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pksunkara/subscriptions","organizations_url":"https://api.github.com/users/pksunkara/orgs","repos_url":"https://api.github.com/users/pksunkara/repos","events_url":"https://api.github.com/users/pksunkara/events{/privacy}","received_events_url":"https://api.github.com/users/pksunkara/received_events","type":"User","site_admin":false},"created_at":"2015-05-22T05:46:03Z","updated_at":"2015-05-22T05:46:03Z","body":"After looking at your desired JSON and resultant JSON, I can safely say that the resultant JSON is not a bug according to our MSON specification. Please read the section pointed out to you by @zdne to understand more about it.\r\n\r\nThat said, You can try to describe the MSON in a different way to get your desired JSON. I am closing this issue."}}