{"action":"opened","number":200,"pull_request":{"url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/200","id":90094238,"html_url":"https://github.com/json-schema-faker/json-schema-faker/pull/200","diff_url":"https://github.com/json-schema-faker/json-schema-faker/pull/200.diff","patch_url":"https://github.com/json-schema-faker/json-schema-faker/pull/200.patch","issue_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/200","number":200,"state":"open","locked":false,"title":"Allow limiting array maxItems and string maxLength","user":{"login":"kylef","id":44164,"avatar_url":"https://avatars.githubusercontent.com/u/44164?v=3","gravatar_id":"","url":"https://api.github.com/users/kylef","html_url":"https://github.com/kylef","followers_url":"https://api.github.com/users/kylef/followers","following_url":"https://api.github.com/users/kylef/following{/other_user}","gists_url":"https://api.github.com/users/kylef/gists{/gist_id}","starred_url":"https://api.github.com/users/kylef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylef/subscriptions","organizations_url":"https://api.github.com/users/kylef/orgs","repos_url":"https://api.github.com/users/kylef/repos","events_url":"https://api.github.com/users/kylef/events{/privacy}","received_events_url":"https://api.github.com/users/kylef/received_events","type":"User","site_admin":false},"body":"Following on the discussion from https://github.com/json-schema-faker/json-schema-faker/issues/199, this PR adds two new options to force a limit of an array items and string length.\r\n\r\nI've tested both of these manually, here's an example:\r\n\r\n```js\r\nvar faker = require('json-schema-faker');\r\n\r\nfaker.option({\r\n  maxItems: 10,\r\n  maxLength: 32,\r\n});\r\n\r\nconsole.log(JSON.stringify(faker({\r\n    \"type\": \"array\",\r\n    \"items\": {\r\n      \"type\": \"string\",\r\n      \"minLength\": 10000,\r\n      \"maxLength\": 100000,\r\n    },\r\n    \"maxItems\": 100,\r\n    \"minItems\": 100,\r\n}), null, 2));\r\n\r\n```\r\n\r\n```json\r\n[\r\n  \"est doid non sit Loremculpa ipsu\",\r\n  \"adlaborumconsequat dolore Lorem \",\r\n  \"eiusmod reprehenderit animut pro\",\r\n  \"irureut sed aliqua exercitationv\",\r\n  \"ex proidentnon ullamco magna mol\",\r\n  \"nonadipisicing officiaanim quide\",\r\n  \"aute nulla temporaliqua laborum \",\r\n  \"officia dolor exercitation adipi\",\r\n  \"laborum sed sit adipisicinganim \",\r\n  \"labore idin ametest culpa deseru\"\r\n]\r\n```\r\n\r\nUnfortunately I'm not entirely sure where the tests would belong for this, can someone point me to the place where tests for this behaviour would belong?","created_at":"2016-10-19T21:28:48Z","updated_at":"2016-10-19T21:28:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/200/commits","review_comments_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/200/comments","review_comment_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/200/comments","statuses_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/statuses/9046ee31d617af5884ea99660edc90452098c557","head":{"label":"kylef:kylef/max-limits","ref":"kylef/max-limits","sha":"9046ee31d617af5884ea99660edc90452098c557","user":{"login":"kylef","id":44164,"avatar_url":"https://avatars.githubusercontent.com/u/44164?v=3","gravatar_id":"","url":"https://api.github.com/users/kylef","html_url":"https://github.com/kylef","followers_url":"https://api.github.com/users/kylef/followers","following_url":"https://api.github.com/users/kylef/following{/other_user}","gists_url":"https://api.github.com/users/kylef/gists{/gist_id}","starred_url":"https://api.github.com/users/kylef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylef/subscriptions","organizations_url":"https://api.github.com/users/kylef/orgs","repos_url":"https://api.github.com/users/kylef/repos","events_url":"https://api.github.com/users/kylef/events{/privacy}","received_events_url":"https://api.github.com/users/kylef/received_events","type":"User","site_admin":false},"repo":{"id":71400576,"name":"json-schema-faker","full_name":"kylef/json-schema-faker","owner":{"login":"kylef","id":44164,"avatar_url":"https://avatars.githubusercontent.com/u/44164?v=3","gravatar_id":"","url":"https://api.github.com/users/kylef","html_url":"https://github.com/kylef","followers_url":"https://api.github.com/users/kylef/followers","following_url":"https://api.github.com/users/kylef/following{/other_user}","gists_url":"https://api.github.com/users/kylef/gists{/gist_id}","starred_url":"https://api.github.com/users/kylef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylef/subscriptions","organizations_url":"https://api.github.com/users/kylef/orgs","repos_url":"https://api.github.com/users/kylef/repos","events_url":"https://api.github.com/users/kylef/events{/privacy}","received_events_url":"https://api.github.com/users/kylef/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kylef/json-schema-faker","description":"JSON-Schema + fake data generators","fork":true,"url":"https://api.github.com/repos/kylef/json-schema-faker","forks_url":"https://api.github.com/repos/kylef/json-schema-faker/forks","keys_url":"https://api.github.com/repos/kylef/json-schema-faker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kylef/json-schema-faker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kylef/json-schema-faker/teams","hooks_url":"https://api.github.com/repos/kylef/json-schema-faker/hooks","issue_events_url":"https://api.github.com/repos/kylef/json-schema-faker/issues/events{/number}","events_url":"https://api.github.com/repos/kylef/json-schema-faker/events","assignees_url":"https://api.github.com/repos/kylef/json-schema-faker/assignees{/user}","branches_url":"https://api.github.com/repos/kylef/json-schema-faker/branches{/branch}","tags_url":"https://api.github.com/repos/kylef/json-schema-faker/tags","blobs_url":"https://api.github.com/repos/kylef/json-schema-faker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kylef/json-schema-faker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kylef/json-schema-faker/git/refs{/sha}","trees_url":"https://api.github.com/repos/kylef/json-schema-faker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kylef/json-schema-faker/statuses/{sha}","languages_url":"https://api.github.com/repos/kylef/json-schema-faker/languages","stargazers_url":"https://api.github.com/repos/kylef/json-schema-faker/stargazers","contributors_url":"https://api.github.com/repos/kylef/json-schema-faker/contributors","subscribers_url":"https://api.github.com/repos/kylef/json-schema-faker/subscribers","subscription_url":"https://api.github.com/repos/kylef/json-schema-faker/subscription","commits_url":"https://api.github.com/repos/kylef/json-schema-faker/commits{/sha}","git_commits_url":"https://api.github.com/repos/kylef/json-schema-faker/git/commits{/sha}","comments_url":"https://api.github.com/repos/kylef/json-schema-faker/comments{/number}","issue_comment_url":"https://api.github.com/repos/kylef/json-schema-faker/issues/comments{/number}","contents_url":"https://api.github.com/repos/kylef/json-schema-faker/contents/{+path}","compare_url":"https://api.github.com/repos/kylef/json-schema-faker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kylef/json-schema-faker/merges","archive_url":"https://api.github.com/repos/kylef/json-schema-faker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kylef/json-schema-faker/downloads","issues_url":"https://api.github.com/repos/kylef/json-schema-faker/issues{/number}","pulls_url":"https://api.github.com/repos/kylef/json-schema-faker/pulls{/number}","milestones_url":"https://api.github.com/repos/kylef/json-schema-faker/milestones{/number}","notifications_url":"https://api.github.com/repos/kylef/json-schema-faker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kylef/json-schema-faker/labels{/name}","releases_url":"https://api.github.com/repos/kylef/json-schema-faker/releases{/id}","deployments_url":"https://api.github.com/repos/kylef/json-schema-faker/deployments","created_at":"2016-10-19T21:25:16Z","updated_at":"2016-10-19T21:25:18Z","pushed_at":"2016-10-19T21:26:56Z","git_url":"git://github.com/kylef/json-schema-faker.git","ssh_url":"git@github.com:kylef/json-schema-faker.git","clone_url":"https://github.com/kylef/json-schema-faker.git","svn_url":"https://github.com/kylef/json-schema-faker","homepage":"http://json-schema-faker.js.org/","size":15899,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":0,"default_branch":"master"}},"base":{"label":"json-schema-faker:master","ref":"master","sha":"63e50e00eb68fef7efce26b2aea1633c9b6debe2","user":{"login":"json-schema-faker","id":13982985,"avatar_url":"https://avatars.githubusercontent.com/u/13982985?v=3","gravatar_id":"","url":"https://api.github.com/users/json-schema-faker","html_url":"https://github.com/json-schema-faker","followers_url":"https://api.github.com/users/json-schema-faker/followers","following_url":"https://api.github.com/users/json-schema-faker/following{/other_user}","gists_url":"https://api.github.com/users/json-schema-faker/gists{/gist_id}","starred_url":"https://api.github.com/users/json-schema-faker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/json-schema-faker/subscriptions","organizations_url":"https://api.github.com/users/json-schema-faker/orgs","repos_url":"https://api.github.com/users/json-schema-faker/repos","events_url":"https://api.github.com/users/json-schema-faker/events{/privacy}","received_events_url":"https://api.github.com/users/json-schema-faker/received_events","type":"Organization","site_admin":false},"repo":{"id":24914297,"name":"json-schema-faker","full_name":"json-schema-faker/json-schema-faker","owner":{"login":"json-schema-faker","id":13982985,"avatar_url":"https://avatars.githubusercontent.com/u/13982985?v=3","gravatar_id":"","url":"https://api.github.com/users/json-schema-faker","html_url":"https://github.com/json-schema-faker","followers_url":"https://api.github.com/users/json-schema-faker/followers","following_url":"https://api.github.com/users/json-schema-faker/following{/other_user}","gists_url":"https://api.github.com/users/json-schema-faker/gists{/gist_id}","starred_url":"https://api.github.com/users/json-schema-faker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/json-schema-faker/subscriptions","organizations_url":"https://api.github.com/users/json-schema-faker/orgs","repos_url":"https://api.github.com/users/json-schema-faker/repos","events_url":"https://api.github.com/users/json-schema-faker/events{/privacy}","received_events_url":"https://api.github.com/users/json-schema-faker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/json-schema-faker/json-schema-faker","description":"JSON-Schema + fake data generators","fork":false,"url":"https://api.github.com/repos/json-schema-faker/json-schema-faker","forks_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/forks","keys_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/teams","hooks_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/hooks","issue_events_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/events{/number}","events_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/events","assignees_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/assignees{/user}","branches_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/branches{/branch}","tags_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/tags","blobs_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/git/refs{/sha}","trees_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/statuses/{sha}","languages_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/languages","stargazers_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/stargazers","contributors_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/contributors","subscribers_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/subscribers","subscription_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/subscription","commits_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/commits{/sha}","git_commits_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/git/commits{/sha}","comments_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/comments{/number}","issue_comment_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/comments{/number}","contents_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/contents/{+path}","compare_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/merges","archive_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/downloads","issues_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues{/number}","pulls_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls{/number}","milestones_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/milestones{/number}","notifications_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/labels{/name}","releases_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/releases{/id}","deployments_url":"https://api.github.com/repos/json-schema-faker/json-schema-faker/deployments","created_at":"2014-10-07T22:23:13Z","updated_at":"2016-10-18T18:02:02Z","pushed_at":"2016-10-19T21:28:49Z","git_url":"git://github.com/json-schema-faker/json-schema-faker.git","ssh_url":"git@github.com:json-schema-faker/json-schema-faker.git","clone_url":"https://github.com/json-schema-faker/json-schema-faker.git","svn_url":"https://github.com/json-schema-faker/json-schema-faker","homepage":"http://json-schema-faker.js.org/","size":15899,"stargazers_count":403,"watchers_count":403,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":49,"mirror_url":null,"open_issues_count":43,"forks":49,"open_issues":43,"watchers":403,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/200"},"html":{"href":"https://github.com/json-schema-faker/json-schema-faker/pull/200"},"issue":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/200"},"comments":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/issues/200/comments"},"review_comments":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/200/comments"},"review_comment":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/pulls/200/commits"},"statuses":{"href":"https://api.github.com/repos/json-schema-faker/json-schema-faker/statuses/9046ee31d617af5884ea99660edc90452098c557"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":68,"deletions":4,"changed_files":7}}
{"actor":{"display_login":"kylef"}}