{"action":"closed","number":10,"pull_request":{"url":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/10","id":57180973,"html_url":"https://github.com/ZhengfengRao/json2cpp/pull/10","diff_url":"https://github.com/ZhengfengRao/json2cpp/pull/10.diff","patch_url":"https://github.com/ZhengfengRao/json2cpp/pull/10.patch","issue_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues/10","number":10,"state":"closed","locked":false,"title":"Update README.md for Anonymous Array and Inheritance.","user":{"login":"nasacj","id":362992,"avatar_url":"https://avatars.githubusercontent.com/u/362992?v=3","gravatar_id":"","url":"https://api.github.com/users/nasacj","html_url":"https://github.com/nasacj","followers_url":"https://api.github.com/users/nasacj/followers","following_url":"https://api.github.com/users/nasacj/following{/other_user}","gists_url":"https://api.github.com/users/nasacj/gists{/gist_id}","starred_url":"https://api.github.com/users/nasacj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasacj/subscriptions","organizations_url":"https://api.github.com/users/nasacj/orgs","repos_url":"https://api.github.com/users/nasacj/repos","events_url":"https://api.github.com/users/nasacj/events{/privacy}","received_events_url":"https://api.github.com/users/nasacj/received_events","type":"User","site_admin":false},"body":"####Anonymous Array\r\njson2cpp supports anonymous array Request/Response, like the following JSON string:\r\n``` json\r\n[\r\n    {\r\n        \"provinceNo\": 10002,\r\n        \"provinceStr\": \"Beijing\",\r\n    },\r\n    {\r\n        \"provinceNo\": 10003,\r\n        \"provinceStr\": \"Hong Kong\",\r\n    }\r\n]\r\n```\r\nThis JSON string only contains an anonymous array of \"*Address*\", so the grammar is defined as following style:\r\n``` cpp\r\n@description=\"AddWare\"\r\nInterface AddWare{\r\n\tRequest {\r\n\t\t@jsonname=\"\", description=\"Request Addresses\"\r\n\t\tvector<Address> addresses;\r\n\t};\r\n\t\r\n\tResponse {\r\n\t\t.......\r\n\t};\r\n```\r\nWhen Request/Respons is an anonymous array JSON string, the ***@jsonname*** MUST be defined as \"\" (null), and the Field should ONLY contains ONE AND ONLY ONE ***vector*** type class or normal type (e.g. vector<*Address*>, vector<*int*>).\r\n\r\n\r\n####Inheritance\r\nUser can use defined Class to be inherited to *Request/Response*, which means user can reuse the definitation of a Class, put the fields of that class into Request/Response.\r\nFor instance, ***Address*** has 2 fields: **{int, string}**. If the *Request* and *Response* are both required as a single ***Address*** Object (NOT an Object contains an Address). So the definitation file can be written as following:\r\n``` cpp\r\n// Tedious definitation:\r\n@description=\"AddWare\"\r\nInterface AddWare{\r\n\tRequest {\r\n\t\t@jsonname=\"provinceNo\", description=\"Province ID\" //@descpription is optional\r\n\t\tint provinceNo;\t\r\n\t\r\n\t\t@jsonname=\"provinceStr\", description=\"Province\"\r\n\t\tstring province;\r\n\t};\r\n\r\n\tResponse {\r\n\t\t@jsonname=\"provinceNo\", description=\"Province ID\" //@descpription is optional\r\n\t\tint provinceNo;\t\r\n\t\r\n\t\t@jsonname=\"provinceStr\", description=\"Province\"\r\n\t\tstring province;\r\n\t};\r\n};\r\n\r\n// Can be simplified as following --->\r\n@description=\"AddWare\"\r\nInterface AddWare{\r\n\tRequest(Address) {};\r\n\tResponse(Address){};\r\n};\r\n```\r\n#####Inheritance Grammar Explanation\r\nIf ***(class_type)*** follows ***Request/Response***, the  Fields in Request/Response is optional (**ZeroOrMore**).\r\nIf *Inheritance* is not used, Fields in Request/Response is **OneOrMore**\r\n","created_at":"2016-01-26T08:21:50Z","updated_at":"2016-01-27T05:54:41Z","closed_at":"2016-01-27T05:54:41Z","merged_at":"2016-01-27T05:54:41Z","merge_commit_sha":"48c97b1fa5008a2bf9ab038c2805e1db326824da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/10/commits","review_comments_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/10/comments","review_comment_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues/10/comments","statuses_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/statuses/8351f66b438d74823e96582d324462488fcb5db6","head":{"label":"nasacj:master","ref":"master","sha":"8351f66b438d74823e96582d324462488fcb5db6","user":{"login":"nasacj","id":362992,"avatar_url":"https://avatars.githubusercontent.com/u/362992?v=3","gravatar_id":"","url":"https://api.github.com/users/nasacj","html_url":"https://github.com/nasacj","followers_url":"https://api.github.com/users/nasacj/followers","following_url":"https://api.github.com/users/nasacj/following{/other_user}","gists_url":"https://api.github.com/users/nasacj/gists{/gist_id}","starred_url":"https://api.github.com/users/nasacj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasacj/subscriptions","organizations_url":"https://api.github.com/users/nasacj/orgs","repos_url":"https://api.github.com/users/nasacj/repos","events_url":"https://api.github.com/users/nasacj/events{/privacy}","received_events_url":"https://api.github.com/users/nasacj/received_events","type":"User","site_admin":false},"repo":{"id":49266208,"name":"json2cpp","full_name":"nasacj/json2cpp","owner":{"login":"nasacj","id":362992,"avatar_url":"https://avatars.githubusercontent.com/u/362992?v=3","gravatar_id":"","url":"https://api.github.com/users/nasacj","html_url":"https://github.com/nasacj","followers_url":"https://api.github.com/users/nasacj/followers","following_url":"https://api.github.com/users/nasacj/following{/other_user}","gists_url":"https://api.github.com/users/nasacj/gists{/gist_id}","starred_url":"https://api.github.com/users/nasacj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasacj/subscriptions","organizations_url":"https://api.github.com/users/nasacj/orgs","repos_url":"https://api.github.com/users/nasacj/repos","events_url":"https://api.github.com/users/nasacj/events{/privacy}","received_events_url":"https://api.github.com/users/nasacj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nasacj/json2cpp","description":"A tool for JSON & C++ Mapping. Interconverting json string and c++ class(convert json string to c++ class, and convert c++ class to json string)","fork":true,"url":"https://api.github.com/repos/nasacj/json2cpp","forks_url":"https://api.github.com/repos/nasacj/json2cpp/forks","keys_url":"https://api.github.com/repos/nasacj/json2cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nasacj/json2cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nasacj/json2cpp/teams","hooks_url":"https://api.github.com/repos/nasacj/json2cpp/hooks","issue_events_url":"https://api.github.com/repos/nasacj/json2cpp/issues/events{/number}","events_url":"https://api.github.com/repos/nasacj/json2cpp/events","assignees_url":"https://api.github.com/repos/nasacj/json2cpp/assignees{/user}","branches_url":"https://api.github.com/repos/nasacj/json2cpp/branches{/branch}","tags_url":"https://api.github.com/repos/nasacj/json2cpp/tags","blobs_url":"https://api.github.com/repos/nasacj/json2cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nasacj/json2cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nasacj/json2cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/nasacj/json2cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nasacj/json2cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/nasacj/json2cpp/languages","stargazers_url":"https://api.github.com/repos/nasacj/json2cpp/stargazers","contributors_url":"https://api.github.com/repos/nasacj/json2cpp/contributors","subscribers_url":"https://api.github.com/repos/nasacj/json2cpp/subscribers","subscription_url":"https://api.github.com/repos/nasacj/json2cpp/subscription","commits_url":"https://api.github.com/repos/nasacj/json2cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/nasacj/json2cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/nasacj/json2cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/nasacj/json2cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/nasacj/json2cpp/contents/{+path}","compare_url":"https://api.github.com/repos/nasacj/json2cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nasacj/json2cpp/merges","archive_url":"https://api.github.com/repos/nasacj/json2cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nasacj/json2cpp/downloads","issues_url":"https://api.github.com/repos/nasacj/json2cpp/issues{/number}","pulls_url":"https://api.github.com/repos/nasacj/json2cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/nasacj/json2cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/nasacj/json2cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nasacj/json2cpp/labels{/name}","releases_url":"https://api.github.com/repos/nasacj/json2cpp/releases{/id}","deployments_url":"https://api.github.com/repos/nasacj/json2cpp/deployments","created_at":"2016-01-08T10:34:22Z","updated_at":"2016-01-20T06:30:40Z","pushed_at":"2016-01-27T02:24:30Z","git_url":"git://github.com/nasacj/json2cpp.git","ssh_url":"git@github.com:nasacj/json2cpp.git","clone_url":"https://github.com/nasacj/json2cpp.git","svn_url":"https://github.com/nasacj/json2cpp","homepage":"https://github.com/ZhengfengRao/json2cpp","size":1290,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"ZhengfengRao:master","ref":"master","sha":"d537f62163f0522dcbc24df46b637bd8c01785b8","user":{"login":"ZhengfengRao","id":1232937,"avatar_url":"https://avatars.githubusercontent.com/u/1232937?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhengfengRao","html_url":"https://github.com/ZhengfengRao","followers_url":"https://api.github.com/users/ZhengfengRao/followers","following_url":"https://api.github.com/users/ZhengfengRao/following{/other_user}","gists_url":"https://api.github.com/users/ZhengfengRao/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhengfengRao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhengfengRao/subscriptions","organizations_url":"https://api.github.com/users/ZhengfengRao/orgs","repos_url":"https://api.github.com/users/ZhengfengRao/repos","events_url":"https://api.github.com/users/ZhengfengRao/events{/privacy}","received_events_url":"https://api.github.com/users/ZhengfengRao/received_events","type":"User","site_admin":false},"repo":{"id":49260217,"name":"json2cpp","full_name":"ZhengfengRao/json2cpp","owner":{"login":"ZhengfengRao","id":1232937,"avatar_url":"https://avatars.githubusercontent.com/u/1232937?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhengfengRao","html_url":"https://github.com/ZhengfengRao","followers_url":"https://api.github.com/users/ZhengfengRao/followers","following_url":"https://api.github.com/users/ZhengfengRao/following{/other_user}","gists_url":"https://api.github.com/users/ZhengfengRao/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhengfengRao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhengfengRao/subscriptions","organizations_url":"https://api.github.com/users/ZhengfengRao/orgs","repos_url":"https://api.github.com/users/ZhengfengRao/repos","events_url":"https://api.github.com/users/ZhengfengRao/events{/privacy}","received_events_url":"https://api.github.com/users/ZhengfengRao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ZhengfengRao/json2cpp","description":"interconverting json string and c++ class(convert json string to c++ class, and convert c++ class to json string)","fork":false,"url":"https://api.github.com/repos/ZhengfengRao/json2cpp","forks_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/forks","keys_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/teams","hooks_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/hooks","issue_events_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues/events{/number}","events_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/events","assignees_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/assignees{/user}","branches_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/branches{/branch}","tags_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/tags","blobs_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/languages","stargazers_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/stargazers","contributors_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/contributors","subscribers_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/subscribers","subscription_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/subscription","commits_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/contents/{+path}","compare_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/merges","archive_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/downloads","issues_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues{/number}","pulls_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/labels{/name}","releases_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/releases{/id}","deployments_url":"https://api.github.com/repos/ZhengfengRao/json2cpp/deployments","created_at":"2016-01-08T08:35:19Z","updated_at":"2016-01-16T04:13:23Z","pushed_at":"2016-01-27T05:54:41Z","git_url":"git://github.com/ZhengfengRao/json2cpp.git","ssh_url":"git@github.com:ZhengfengRao/json2cpp.git","clone_url":"https://github.com/ZhengfengRao/json2cpp.git","svn_url":"https://github.com/ZhengfengRao/json2cpp","homepage":null,"size":1292,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/10"},"html":{"href":"https://github.com/ZhengfengRao/json2cpp/pull/10"},"issue":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues/10"},"comments":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/ZhengfengRao/json2cpp/statuses/8351f66b438d74823e96582d324462488fcb5db6"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"ZhengfengRao","id":1232937,"avatar_url":"https://avatars.githubusercontent.com/u/1232937?v=3","gravatar_id":"","url":"https://api.github.com/users/ZhengfengRao","html_url":"https://github.com/ZhengfengRao","followers_url":"https://api.github.com/users/ZhengfengRao/followers","following_url":"https://api.github.com/users/ZhengfengRao/following{/other_user}","gists_url":"https://api.github.com/users/ZhengfengRao/gists{/gist_id}","starred_url":"https://api.github.com/users/ZhengfengRao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZhengfengRao/subscriptions","organizations_url":"https://api.github.com/users/ZhengfengRao/orgs","repos_url":"https://api.github.com/users/ZhengfengRao/repos","events_url":"https://api.github.com/users/ZhengfengRao/events{/privacy}","received_events_url":"https://api.github.com/users/ZhengfengRao/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":5,"additions":68,"deletions":4,"changed_files":3}}