{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback/issues/1218","labels_url":"https://api.github.com/repos/strongloop/loopback/issues/1218/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback/issues/1218/comments","events_url":"https://api.github.com/repos/strongloop/loopback/issues/1218/events","html_url":"https://github.com/strongloop/loopback/issues/1218","id":62516490,"number":1218,"title":"IDs are being generated for Model that has a base of \"Model\"","user":{"login":"dashby3000","id":4146430,"avatar_url":"https://avatars.githubusercontent.com/u/4146430?v=3","gravatar_id":"","url":"https://api.github.com/users/dashby3000","html_url":"https://github.com/dashby3000","followers_url":"https://api.github.com/users/dashby3000/followers","following_url":"https://api.github.com/users/dashby3000/following{/other_user}","gists_url":"https://api.github.com/users/dashby3000/gists{/gist_id}","starred_url":"https://api.github.com/users/dashby3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dashby3000/subscriptions","organizations_url":"https://api.github.com/users/dashby3000/orgs","repos_url":"https://api.github.com/users/dashby3000/repos","events_url":"https://api.github.com/users/dashby3000/events{/privacy}","received_events_url":"https://api.github.com/users/dashby3000/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback/labels/%23sprint67","name":"#sprint67","color":"ededed"},{"url":"https://api.github.com/repos/strongloop/loopback/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/strongloop/loopback/labels/critical","name":"critical","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"raymondfeng","id":540892,"avatar_url":"https://avatars.githubusercontent.com/u/540892?v=3","gravatar_id":"","url":"https://api.github.com/users/raymondfeng","html_url":"https://github.com/raymondfeng","followers_url":"https://api.github.com/users/raymondfeng/followers","following_url":"https://api.github.com/users/raymondfeng/following{/other_user}","gists_url":"https://api.github.com/users/raymondfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondfeng/subscriptions","organizations_url":"https://api.github.com/users/raymondfeng/orgs","repos_url":"https://api.github.com/users/raymondfeng/repos","events_url":"https://api.github.com/users/raymondfeng/events{/privacy}","received_events_url":"https://api.github.com/users/raymondfeng/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/strongloop/loopback/milestones/18","html_url":"https://github.com/strongloop/loopback/milestones/%23Epic:%20GoDaddy","labels_url":"https://api.github.com/repos/strongloop/loopback/milestones/18/labels","id":930972,"number":18,"title":"#Epic: GoDaddy","description":null,"creator":{"login":"chandadharap","id":4267700,"avatar_url":"https://avatars.githubusercontent.com/u/4267700?v=3","gravatar_id":"","url":"https://api.github.com/users/chandadharap","html_url":"https://github.com/chandadharap","followers_url":"https://api.github.com/users/chandadharap/followers","following_url":"https://api.github.com/users/chandadharap/following{/other_user}","gists_url":"https://api.github.com/users/chandadharap/gists{/gist_id}","starred_url":"https://api.github.com/users/chandadharap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chandadharap/subscriptions","organizations_url":"https://api.github.com/users/chandadharap/orgs","repos_url":"https://api.github.com/users/chandadharap/repos","events_url":"https://api.github.com/users/chandadharap/events{/privacy}","received_events_url":"https://api.github.com/users/chandadharap/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1,"state":"open","created_at":"2015-01-12T05:27:20Z","updated_at":"2015-03-17T21:56:19Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-03-17T20:56:18Z","updated_at":"2015-03-26T21:08:46Z","closed_at":null,"body":"If I have a `model` defined as such:\r\n\r\n```javascript\r\n{\r\n  \"name\": \"Foo\",\r\n  \"base\": \"Model\",\r\n  \"idInjection\": false,\r\n  \"properties\": {\r\n    \"bar\": {\r\n      \"type\": \"string\"\r\n    }\r\n  },\r\n  \"validations\": [],\r\n  \"relations\": {},\r\n  \"acls\": [],\r\n  \"methods\": []\r\n}\r\n```\r\n\r\nAnd it referenced as a `type` in a model defined like this:\r\n\r\n```javascript\r\n{\r\n  \"name\": \"MyModel\",\r\n  \"base\": \"PersistedModel\",\r\n  \"idInjection\": true,\r\n  \"properties\": {\r\n    \"sample\": {\r\n      \"type\": \"Foo\"\r\n    }\r\n  },\r\n  \"validations\": [],\r\n  \"relations\": {},\r\n  \"acls\": [],\r\n  \"methods\": []\r\n}\r\n```\r\n\r\nIn Swagger, it generates the following:\r\n\r\n```javascript\r\n{\r\n  \"sample\": {\r\n    \"bar\": \"\",\r\n    \"id\": 0\r\n  },\r\n  \"id\": 0\r\n}\r\n```\r\n\r\nThe `id` field from the model `Foo` should not be necessary since it is not a `PersistedModel`.  The only way to get rid of it is to make one of the required properties of `Foo` and `id` field.  \r\n\r\nHowever, this is not a suitable workaround if none of the properties of `Foo` are required.\r\n\r\nref: PLATAPI-361"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback/issues/comments/86718756","html_url":"https://github.com/strongloop/loopback/issues/1218#issuecomment-86718756","issue_url":"https://api.github.com/repos/strongloop/loopback/issues/1218","id":86718756,"user":{"login":"raymondfeng","id":540892,"avatar_url":"https://avatars.githubusercontent.com/u/540892?v=3","gravatar_id":"","url":"https://api.github.com/users/raymondfeng","html_url":"https://github.com/raymondfeng","followers_url":"https://api.github.com/users/raymondfeng/followers","following_url":"https://api.github.com/users/raymondfeng/following{/other_user}","gists_url":"https://api.github.com/users/raymondfeng/gists{/gist_id}","starred_url":"https://api.github.com/users/raymondfeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raymondfeng/subscriptions","organizations_url":"https://api.github.com/users/raymondfeng/orgs","repos_url":"https://api.github.com/users/raymondfeng/repos","events_url":"https://api.github.com/users/raymondfeng/events{/privacy}","received_events_url":"https://api.github.com/users/raymondfeng/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T21:08:46Z","updated_at":"2015-03-26T21:08:46Z","body":"@dashby3000 Please verify the solution."}}