{"action":"opened","issue":{"url":"https://api.github.com/repos/elastic-rs/elastic/issues/312","repository_url":"https://api.github.com/repos/elastic-rs/elastic","labels_url":"https://api.github.com/repos/elastic-rs/elastic/issues/312/labels{/name}","comments_url":"https://api.github.com/repos/elastic-rs/elastic/issues/312/comments","events_url":"https://api.github.com/repos/elastic-rs/elastic/issues/312/events","html_url":"https://github.com/elastic-rs/elastic/issues/312","id":324901848,"number":312,"title":"Use object type over nested type with nested structures?","user":{"login":"AlexKornitzer","id":2750747,"avatar_url":"https://avatars0.githubusercontent.com/u/2750747?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexKornitzer","html_url":"https://github.com/AlexKornitzer","followers_url":"https://api.github.com/users/AlexKornitzer/followers","following_url":"https://api.github.com/users/AlexKornitzer/following{/other_user}","gists_url":"https://api.github.com/users/AlexKornitzer/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexKornitzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexKornitzer/subscriptions","organizations_url":"https://api.github.com/users/AlexKornitzer/orgs","repos_url":"https://api.github.com/users/AlexKornitzer/repos","events_url":"https://api.github.com/users/AlexKornitzer/events{/privacy}","received_events_url":"https://api.github.com/users/AlexKornitzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-21T12:41:09Z","updated_at":"2018-05-21T12:41:09Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nSimilar to what I believe is implemented here: https://github.com/elastic-rs/elastic/issues/72. Is there a way to tell elastic-rs that I want it to auto derive the mapping yet override the type to `object` instead of `nested`?\r\n\r\n```\r\n#[derive(ElasticType)]\r\npub struct B {\r\n    pub b: String,\r\n}\r\n\r\n#[derive(ElasticType)]\r\npub struct A {\r\n    pub a: String,\r\n    #[elastic(ty=\"object\")]  <- Prefer object over nested?!\r\n    pub b: Option<B>\r\n}\r\n```\r\n\r\nApologies if this already exists and I have just totally glossed over it. Currently when I look in the elastic mapping my nested structures are always type nested which I do not want, I do not need the nested overhead and hence need these to be type object but do not really want to create these mappings by hand. Otherwise awesome library :D"}}
{"actor":{"display_login":"AlexKornitzer"}}