{"action":"created","issue":{"url":"https://api.github.com/repos/emicklei/go-restful-openapi/issues/40","repository_url":"https://api.github.com/repos/emicklei/go-restful-openapi","labels_url":"https://api.github.com/repos/emicklei/go-restful-openapi/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/emicklei/go-restful-openapi/issues/40/comments","events_url":"https://api.github.com/repos/emicklei/go-restful-openapi/issues/40/events","html_url":"https://github.com/emicklei/go-restful-openapi/issues/40","id":290683337,"number":40,"title":"support additionalProperties","user":{"login":"Jack47","id":1720972,"avatar_url":"https://avatars3.githubusercontent.com/u/1720972?v=4","gravatar_id":"","url":"https://api.github.com/users/Jack47","html_url":"https://github.com/Jack47","followers_url":"https://api.github.com/users/Jack47/followers","following_url":"https://api.github.com/users/Jack47/following{/other_user}","gists_url":"https://api.github.com/users/Jack47/gists{/gist_id}","starred_url":"https://api.github.com/users/Jack47/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jack47/subscriptions","organizations_url":"https://api.github.com/users/Jack47/orgs","repos_url":"https://api.github.com/users/Jack47/repos","events_url":"https://api.github.com/users/Jack47/events{/privacy}","received_events_url":"https://api.github.com/users/Jack47/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-01-23T02:05:35Z","updated_at":"2018-05-09T16:49:00Z","closed_at":null,"author_association":"NONE","body":"Currently go-restful-openapi don't support [additionalProperties](https://spacetelescope.github.io/understanding-json-schema/reference/object.html#properties). It's useful for scenearios like below.\r\n\r\n```\r\ntype GroupInfo struct {\r\n  count int\r\n  members  map[string]MemberInfo\r\n}\r\ntype MemberInfo struct {\r\n  name string\r\n  endpoint string\r\n}\r\n```\r\n\r\nWe can use additionalProperties to generate schema for `members`:\r\n```\r\nmembers: {\r\n  \"type\": \"object\",\r\n  \"patternProperties\": {\r\n    \"^[a-zA-Z]+$\": {\r\n       \"type\": \"object\",\r\n       \"properties\": {\r\n          \"name\": {\"type\": \"string\"},\r\n          \"endpoint\": {\"type\": \"string\"}\r\n       },\r\n       \"additionalProperties\": true\r\n    }\r\n  }\r\n}\r\n```\r\nDo you have some suggestions on this?"},"comment":{"url":"https://api.github.com/repos/emicklei/go-restful-openapi/issues/comments/387803178","html_url":"https://github.com/emicklei/go-restful-openapi/issues/40#issuecomment-387803178","issue_url":"https://api.github.com/repos/emicklei/go-restful-openapi/issues/40","id":387803178,"user":{"login":"tekkamanendless","id":4185421,"avatar_url":"https://avatars3.githubusercontent.com/u/4185421?v=4","gravatar_id":"","url":"https://api.github.com/users/tekkamanendless","html_url":"https://github.com/tekkamanendless","followers_url":"https://api.github.com/users/tekkamanendless/followers","following_url":"https://api.github.com/users/tekkamanendless/following{/other_user}","gists_url":"https://api.github.com/users/tekkamanendless/gists{/gist_id}","starred_url":"https://api.github.com/users/tekkamanendless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tekkamanendless/subscriptions","organizations_url":"https://api.github.com/users/tekkamanendless/orgs","repos_url":"https://api.github.com/users/tekkamanendless/repos","events_url":"https://api.github.com/users/tekkamanendless/events{/privacy}","received_events_url":"https://api.github.com/users/tekkamanendless/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T16:49:00Z","updated_at":"2018-05-09T16:49:00Z","author_association":"CONTRIBUTOR","body":"If the intent of this issue is to support maps of well-defined types, then #44 might do what you want."}}
{"actor":{"display_login":"tekkamanendless"}}