{"action":"created","issue":{"url":"https://api.github.com/repos/twittner/swagger/issues/2","labels_url":"https://api.github.com/repos/twittner/swagger/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/twittner/swagger/issues/2/comments","events_url":"https://api.github.com/repos/twittner/swagger/issues/2/events","html_url":"https://github.com/twittner/swagger/issues/2","id":59754805,"number":2,"title":"How do I embed json objects with ModelBuilder?","user":{"login":"dmjio","id":875324,"avatar_url":"https://avatars.githubusercontent.com/u/875324?v=3","gravatar_id":"","url":"https://api.github.com/users/dmjio","html_url":"https://github.com/dmjio","followers_url":"https://api.github.com/users/dmjio/followers","following_url":"https://api.github.com/users/dmjio/following{/other_user}","gists_url":"https://api.github.com/users/dmjio/gists{/gist_id}","starred_url":"https://api.github.com/users/dmjio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmjio/subscriptions","organizations_url":"https://api.github.com/users/dmjio/orgs","repos_url":"https://api.github.com/users/dmjio/repos","events_url":"https://api.github.com/users/dmjio/events{/privacy}","received_events_url":"https://api.github.com/users/dmjio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-04T06:12:20Z","updated_at":"2015-03-04T08:30:00Z","closed_at":null,"body":"I'm trying to create the following structure in json for a `Model`.\r\n\r\n```json\r\n{ \r\n  \"post\" : { \r\n     \"postid\" : \"abc-xyz-123\",\r\n     \"created: 123123123123\r\n    } \r\n}\r\n```\r\n\r\nBut there's no function to create an object property. So I just do something like this:\r\n\r\n```haskell\r\n  defineModel \"post\" $ do                                                                                                                                                       \r\n        description \"post\"                                                                                                                                                        \r\n        property \"id\" string' $ description \"Id of the Post\"                                                                                                                      \r\n        property \"created\" int64' $ description \"Epoch creation time\"      \r\n```\r\n\r\nBut that produces json which looks like:\r\n\r\n```json\r\n{ \r\n     \"postid\" : \"abc-xyz-123\",\r\n     \"created: 123123123123\r\n    } \r\n```\r\n\r\nHow do I embed objects in objects? Or models in models?\r\n\r\nThank you for making this library!"},"comment":{"url":"https://api.github.com/repos/twittner/swagger/issues/comments/77115906","html_url":"https://github.com/twittner/swagger/issues/2#issuecomment-77115906","issue_url":"https://api.github.com/repos/twittner/swagger/issues/2","id":77115906,"user":{"login":"twittner","id":132165,"avatar_url":"https://avatars.githubusercontent.com/u/132165?v=3","gravatar_id":"","url":"https://api.github.com/users/twittner","html_url":"https://github.com/twittner","followers_url":"https://api.github.com/users/twittner/followers","following_url":"https://api.github.com/users/twittner/following{/other_user}","gists_url":"https://api.github.com/users/twittner/gists{/gist_id}","starred_url":"https://api.github.com/users/twittner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twittner/subscriptions","organizations_url":"https://api.github.com/users/twittner/orgs","repos_url":"https://api.github.com/users/twittner/repos","events_url":"https://api.github.com/users/twittner/events{/privacy}","received_events_url":"https://api.github.com/users/twittner/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T08:30:00Z","updated_at":"2015-03-04T08:30:00Z","body":"The [swagger spec](https://github.com/swagger-api/swagger-spec/blob/master/versions/1.2.md#433-data-type-fields) uses references for this case. You define two models an let one refer to the other, e.g.\r\n\r\n```haskell\r\nmodelA = defineModel \"modelA\" $ ...\r\nmodelB = defineModel \"modelB\" $ do\r\n    property \"foo\" (ref modelA) $\r\n        description \"foo is of type ModelA\"\r\n```"}}