{"action":"created","issue":{"url":"https://api.github.com/repos/yayoc/swagger-to-flowtype/issues/6","repository_url":"https://api.github.com/repos/yayoc/swagger-to-flowtype","labels_url":"https://api.github.com/repos/yayoc/swagger-to-flowtype/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/yayoc/swagger-to-flowtype/issues/6/comments","events_url":"https://api.github.com/repos/yayoc/swagger-to-flowtype/issues/6/events","html_url":"https://github.com/yayoc/swagger-to-flowtype/issues/6","id":239172232,"number":6,"title":"Optional object type properties","user":{"login":"desmondhume","id":1183744,"avatar_url":"https://avatars1.githubusercontent.com/u/1183744?v=3","gravatar_id":"","url":"https://api.github.com/users/desmondhume","html_url":"https://github.com/desmondhume","followers_url":"https://api.github.com/users/desmondhume/followers","following_url":"https://api.github.com/users/desmondhume/following{/other_user}","gists_url":"https://api.github.com/users/desmondhume/gists{/gist_id}","starred_url":"https://api.github.com/users/desmondhume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/desmondhume/subscriptions","organizations_url":"https://api.github.com/users/desmondhume/orgs","repos_url":"https://api.github.com/users/desmondhume/repos","events_url":"https://api.github.com/users/desmondhume/events{/privacy}","received_events_url":"https://api.github.com/users/desmondhume/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-28T13:55:21Z","updated_at":"2017-06-29T07:47:12Z","closed_at":null,"body":"Is it supported as of now? It seems like there's no check on the `required` field of swagger manifest.\r\n\r\nFor example:\r\n\r\n```json\r\n{\r\n  \"definitions\": {\r\n    \"User\": {\r\n      \"type\": \"object\",\r\n      \"required\": [\r\n        \"email\"\r\n      ],\r\n      \"properties\": {\r\n        \"username\": {\r\n          \"type\": \"string\",\r\n          \"description\": \"User username\"\r\n        },\r\n        \"email\": {\r\n          \"type\": \"string\",\r\n          \"description\": \"User email\"\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nshould output: \r\n\r\n```js\r\nexport type User = {\r\n  username?: string,\r\n  email: string\r\n};\r\n```\r\n\r\nDo you think a PR might be helpful? \r\n\r\nThis tool is super useful for me at the moment 😄 "},"comment":{"url":"https://api.github.com/repos/yayoc/swagger-to-flowtype/issues/comments/311889463","html_url":"https://github.com/yayoc/swagger-to-flowtype/issues/6#issuecomment-311889463","issue_url":"https://api.github.com/repos/yayoc/swagger-to-flowtype/issues/6","id":311889463,"user":{"login":"yayoc","id":6383334,"avatar_url":"https://avatars0.githubusercontent.com/u/6383334?v=3","gravatar_id":"","url":"https://api.github.com/users/yayoc","html_url":"https://github.com/yayoc","followers_url":"https://api.github.com/users/yayoc/followers","following_url":"https://api.github.com/users/yayoc/following{/other_user}","gists_url":"https://api.github.com/users/yayoc/gists{/gist_id}","starred_url":"https://api.github.com/users/yayoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yayoc/subscriptions","organizations_url":"https://api.github.com/users/yayoc/orgs","repos_url":"https://api.github.com/users/yayoc/repos","events_url":"https://api.github.com/users/yayoc/events{/privacy}","received_events_url":"https://api.github.com/users/yayoc/received_events","type":"User","site_admin":false},"created_at":"2017-06-29T07:47:12Z","updated_at":"2017-06-29T07:47:12Z","body":"Supporting optional looks useful😀\r\nAs far as I know, unfortunately, swagger ( ver2 ) is not supporting null type.\r\nSo, I think the format should be:\r\n\r\n```json\r\n    \"NewPet\": {\r\n      \"type\": \"object\",\r\n      \"required\": [\r\n        \"name\"\r\n      ],\r\n      \"properties\": {\r\n        \"name\": {\r\n          \"type\": \"string\"\r\n        },\r\n        \"tag\": {\r\n          \"type\": \"string\"\r\n        }\r\n      }\r\n    }\r\n```\r\n\r\nwill be\r\n\r\n```js\r\nexport type NewPet = {\r\n    name: string,\r\n    tag?: string\r\n}\r\n```"}}
{"actor":{"display_login":"yayoc"}}