{"action":"created","issue":{"url":"https://api.github.com/repos/olivierlsc/swagger-express-ts/issues/2","repository_url":"https://api.github.com/repos/olivierlsc/swagger-express-ts","labels_url":"https://api.github.com/repos/olivierlsc/swagger-express-ts/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/olivierlsc/swagger-express-ts/issues/2/comments","events_url":"https://api.github.com/repos/olivierlsc/swagger-express-ts/issues/2/events","html_url":"https://github.com/olivierlsc/swagger-express-ts/issues/2","id":299934180,"number":2,"title":"Enhancement idea : Mix with typegoose","user":{"login":"xrobert35","id":33020856,"avatar_url":"https://avatars3.githubusercontent.com/u/33020856?v=4","gravatar_id":"","url":"https://api.github.com/users/xrobert35","html_url":"https://github.com/xrobert35","followers_url":"https://api.github.com/users/xrobert35/followers","following_url":"https://api.github.com/users/xrobert35/following{/other_user}","gists_url":"https://api.github.com/users/xrobert35/gists{/gist_id}","starred_url":"https://api.github.com/users/xrobert35/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xrobert35/subscriptions","organizations_url":"https://api.github.com/users/xrobert35/orgs","repos_url":"https://api.github.com/users/xrobert35/repos","events_url":"https://api.github.com/users/xrobert35/events{/privacy}","received_events_url":"https://api.github.com/users/xrobert35/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-24T11:25:35Z","updated_at":"2018-03-06T21:52:37Z","closed_at":null,"author_association":"NONE","body":"Hello :),\r\n\r\nI'm currently working with typegoose on a new project I started to write something to dynamically generate swagger model from Typegoose schema.\r\n\r\nhttps://github.com/szokodiakos/typegoose\r\n\r\nHere's a start idea :\r\n```\r\ngetSwaggerProperties() {\r\n    // Get the schema\r\n    const userSchema = new UserSchema().getModelForClass(UserSchema);\r\n    const user = {\r\n      User: {\r\n        properties: {}\r\n      }\r\n    };\r\n   // Iterate throught schema properties to get swagger model\r\n    Object.keys(userSchema.schema.obj).forEach((key) => {\r\n      user.User.properties[key] = {\r\n        type: userSchema.schema.obj[key].type.name.toLowerCase(),\r\n        required: userSchema.schema.obj[key].required\r\n      };\r\n    });\r\n    return user;\r\n  }\r\n```\r\n\r\nWhat do you think about it ? \r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/olivierlsc/swagger-express-ts/issues/comments/370941921","html_url":"https://github.com/olivierlsc/swagger-express-ts/issues/2#issuecomment-370941921","issue_url":"https://api.github.com/repos/olivierlsc/swagger-express-ts/issues/2","id":370941921,"user":{"login":"olivierlsc","id":10076904,"avatar_url":"https://avatars2.githubusercontent.com/u/10076904?v=4","gravatar_id":"","url":"https://api.github.com/users/olivierlsc","html_url":"https://github.com/olivierlsc","followers_url":"https://api.github.com/users/olivierlsc/followers","following_url":"https://api.github.com/users/olivierlsc/following{/other_user}","gists_url":"https://api.github.com/users/olivierlsc/gists{/gist_id}","starred_url":"https://api.github.com/users/olivierlsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivierlsc/subscriptions","organizations_url":"https://api.github.com/users/olivierlsc/orgs","repos_url":"https://api.github.com/users/olivierlsc/repos","events_url":"https://api.github.com/users/olivierlsc/events{/privacy}","received_events_url":"https://api.github.com/users/olivierlsc/received_events","type":"User","site_admin":false},"created_at":"2018-03-06T21:52:37Z","updated_at":"2018-03-06T21:52:37Z","author_association":"OWNER","body":"Hi @xrobert35 ,\r\nI propose to create 2 decorators :\r\n1. @ApiModel({\r\nname: \"User\"\r\n...\r\n})\r\n2. @ApiProperty({\r\nrequired: true\r\n...\r\n})\r\nWhat do you think about it ?\r\nThanks.\r\n"}}
{"actor":{"display_login":"olivierlsc"}}