{"action":"created","comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments/62442651","id":62442651,"diff_hunk":"@@ -103,6 +104,31 @@ def test_endpoint_parameters(self, number, double, string, byte, **kwargs):\n         if ('byte' not in params) or (params['byte'] is None):\n             raise ValueError(\"Missing the required parameter `byte` when calling `test_endpoint_parameters`\")\n \n+        if 'number' in params and params['number'] > 543.2: \n+            raise ValueError(\"Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to  `543.2`\")\n+        if 'number' in params and params['number'] < 32.1: \n+            raise ValueError(\"Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`\")\n+        if 'double' in params and params['double'] > 123.4: \n+            raise ValueError(\"Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to  `123.4`\")\n+        if 'double' in params and params['double'] < 67.8: \n+            raise ValueError(\"Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`\")\n+        if 'string' in params and not re.search('[a-z]', params['string'], flags=re.IGNORECASE): \n+            raise ValueError(\"Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`\")","path":"samples/client/petstore/python/swagger_client/apis/fake_api.py","position":21,"original_position":21,"commit_id":"4718c34984cc5a8915f8bf6db41ebd98fd001815","original_commit_id":"25ebd5466de888fa2ac49873466b30792c9f70e9","user":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"body":"When I looked this earlier (http://stackoverflow.com/a/23613042/677735), I was thinking about updating the `pattern` to `'FIle:/+(.*)',re.IGNORECASE` with the following template:\r\n```\r\n{{#pattern}}\r\npattern = re.compile({{{.}}})\r\nif pattern.match(params['{{name}}]):\r\n...\r\n{{/pattern}}\r\n```\r\nOn course your solution using vendor extension works as well.","created_at":"2016-05-09T01:16:36Z","updated_at":"2016-05-09T01:16:36Z","html_url":"https://github.com/swagger-api/swagger-codegen/pull/2794#discussion_r62442651","pull_request_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794","_links":{"self":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments/62442651"},"html":{"href":"https://github.com/swagger-api/swagger-codegen/pull/2794#discussion_r62442651"},"pull_request":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794"}}},"pull_request":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794","id":69216612,"html_url":"https://github.com/swagger-api/swagger-codegen/pull/2794","diff_url":"https://github.com/swagger-api/swagger-codegen/pull/2794.diff","patch_url":"https://github.com/swagger-api/swagger-codegen/pull/2794.patch","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2794","number":2794,"state":"open","locked":false,"title":"Add validation to Python client","user":{"login":"scottrw93","id":6473599,"avatar_url":"https://avatars.githubusercontent.com/u/6473599?v=3","gravatar_id":"","url":"https://api.github.com/users/scottrw93","html_url":"https://github.com/scottrw93","followers_url":"https://api.github.com/users/scottrw93/followers","following_url":"https://api.github.com/users/scottrw93/following{/other_user}","gists_url":"https://api.github.com/users/scottrw93/gists{/gist_id}","starred_url":"https://api.github.com/users/scottrw93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottrw93/subscriptions","organizations_url":"https://api.github.com/users/scottrw93/orgs","repos_url":"https://api.github.com/users/scottrw93/repos","events_url":"https://api.github.com/users/scottrw93/events{/privacy}","received_events_url":"https://api.github.com/users/scottrw93/received_events","type":"User","site_admin":false},"body":"Python client validation for #2663. Just two questions about this:\r\n\r\nOne think to note is the regex defined [the test spec](https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml#L615). This pattern, `pattern: /[a-z]/i`, will work with the Ruby client allowing strings containing only upper or lower case letters. This will not be the case for the Python client and other clients I think. Should this be made more generic in the example.\r\n\r\nAlso, the [Ruby client](https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/ruby/api.mustache#L50) supports allowable values on the Api paramters. Does the spec allow you define an enumerator on a parameter in an operation and if so do you have an example? I thought it was only parameters in models that could be an enum.","created_at":"2016-05-06T22:02:09Z","updated_at":"2016-05-09T01:16:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a43715d127f7d27705c11fbd90c82ff57f132378","assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/9","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.0","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/9/labels","id":1375944,"number":9,"title":"v2.2.0","description":"","creator":{"login":"fehguy","id":249413,"avatar_url":"https://avatars.githubusercontent.com/u/249413?v=3","gravatar_id":"","url":"https://api.github.com/users/fehguy","html_url":"https://github.com/fehguy","followers_url":"https://api.github.com/users/fehguy/followers","following_url":"https://api.github.com/users/fehguy/following{/other_user}","gists_url":"https://api.github.com/users/fehguy/gists{/gist_id}","starred_url":"https://api.github.com/users/fehguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fehguy/subscriptions","organizations_url":"https://api.github.com/users/fehguy/orgs","repos_url":"https://api.github.com/users/fehguy/repos","events_url":"https://api.github.com/users/fehguy/events{/privacy}","received_events_url":"https://api.github.com/users/fehguy/received_events","type":"User","site_admin":false},"open_issues":161,"closed_issues":232,"state":"open","created_at":"2015-10-25T23:43:33Z","updated_at":"2016-05-08T17:14:48Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794/commits","review_comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794/comments","review_comment_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2794/comments","statuses_url":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/4718c34984cc5a8915f8bf6db41ebd98fd001815","head":{"label":"scottrw93:validation","ref":"validation","sha":"4718c34984cc5a8915f8bf6db41ebd98fd001815","user":{"login":"scottrw93","id":6473599,"avatar_url":"https://avatars.githubusercontent.com/u/6473599?v=3","gravatar_id":"","url":"https://api.github.com/users/scottrw93","html_url":"https://github.com/scottrw93","followers_url":"https://api.github.com/users/scottrw93/followers","following_url":"https://api.github.com/users/scottrw93/following{/other_user}","gists_url":"https://api.github.com/users/scottrw93/gists{/gist_id}","starred_url":"https://api.github.com/users/scottrw93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottrw93/subscriptions","organizations_url":"https://api.github.com/users/scottrw93/orgs","repos_url":"https://api.github.com/users/scottrw93/repos","events_url":"https://api.github.com/users/scottrw93/events{/privacy}","received_events_url":"https://api.github.com/users/scottrw93/received_events","type":"User","site_admin":false},"repo":{"id":48825858,"name":"swagger-codegen","full_name":"scottrw93/swagger-codegen","owner":{"login":"scottrw93","id":6473599,"avatar_url":"https://avatars.githubusercontent.com/u/6473599?v=3","gravatar_id":"","url":"https://api.github.com/users/scottrw93","html_url":"https://github.com/scottrw93","followers_url":"https://api.github.com/users/scottrw93/followers","following_url":"https://api.github.com/users/scottrw93/following{/other_user}","gists_url":"https://api.github.com/users/scottrw93/gists{/gist_id}","starred_url":"https://api.github.com/users/scottrw93/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scottrw93/subscriptions","organizations_url":"https://api.github.com/users/scottrw93/orgs","repos_url":"https://api.github.com/users/scottrw93/repos","events_url":"https://api.github.com/users/scottrw93/events{/privacy}","received_events_url":"https://api.github.com/users/scottrw93/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scottrw93/swagger-codegen","description":"swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.","fork":true,"url":"https://api.github.com/repos/scottrw93/swagger-codegen","forks_url":"https://api.github.com/repos/scottrw93/swagger-codegen/forks","keys_url":"https://api.github.com/repos/scottrw93/swagger-codegen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scottrw93/swagger-codegen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scottrw93/swagger-codegen/teams","hooks_url":"https://api.github.com/repos/scottrw93/swagger-codegen/hooks","issue_events_url":"https://api.github.com/repos/scottrw93/swagger-codegen/issues/events{/number}","events_url":"https://api.github.com/repos/scottrw93/swagger-codegen/events","assignees_url":"https://api.github.com/repos/scottrw93/swagger-codegen/assignees{/user}","branches_url":"https://api.github.com/repos/scottrw93/swagger-codegen/branches{/branch}","tags_url":"https://api.github.com/repos/scottrw93/swagger-codegen/tags","blobs_url":"https://api.github.com/repos/scottrw93/swagger-codegen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scottrw93/swagger-codegen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scottrw93/swagger-codegen/git/refs{/sha}","trees_url":"https://api.github.com/repos/scottrw93/swagger-codegen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scottrw93/swagger-codegen/statuses/{sha}","languages_url":"https://api.github.com/repos/scottrw93/swagger-codegen/languages","stargazers_url":"https://api.github.com/repos/scottrw93/swagger-codegen/stargazers","contributors_url":"https://api.github.com/repos/scottrw93/swagger-codegen/contributors","subscribers_url":"https://api.github.com/repos/scottrw93/swagger-codegen/subscribers","subscription_url":"https://api.github.com/repos/scottrw93/swagger-codegen/subscription","commits_url":"https://api.github.com/repos/scottrw93/swagger-codegen/commits{/sha}","git_commits_url":"https://api.github.com/repos/scottrw93/swagger-codegen/git/commits{/sha}","comments_url":"https://api.github.com/repos/scottrw93/swagger-codegen/comments{/number}","issue_comment_url":"https://api.github.com/repos/scottrw93/swagger-codegen/issues/comments{/number}","contents_url":"https://api.github.com/repos/scottrw93/swagger-codegen/contents/{+path}","compare_url":"https://api.github.com/repos/scottrw93/swagger-codegen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scottrw93/swagger-codegen/merges","archive_url":"https://api.github.com/repos/scottrw93/swagger-codegen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scottrw93/swagger-codegen/downloads","issues_url":"https://api.github.com/repos/scottrw93/swagger-codegen/issues{/number}","pulls_url":"https://api.github.com/repos/scottrw93/swagger-codegen/pulls{/number}","milestones_url":"https://api.github.com/repos/scottrw93/swagger-codegen/milestones{/number}","notifications_url":"https://api.github.com/repos/scottrw93/swagger-codegen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scottrw93/swagger-codegen/labels{/name}","releases_url":"https://api.github.com/repos/scottrw93/swagger-codegen/releases{/id}","deployments_url":"https://api.github.com/repos/scottrw93/swagger-codegen/deployments","created_at":"2015-12-31T00:52:10Z","updated_at":"2016-03-02T22:24:15Z","pushed_at":"2016-05-09T00:25:42Z","git_url":"git://github.com/scottrw93/swagger-codegen.git","ssh_url":"git@github.com:scottrw93/swagger-codegen.git","clone_url":"https://github.com/scottrw93/swagger-codegen.git","svn_url":"https://github.com/scottrw93/swagger-codegen","homepage":"http://swagger.io","size":27654,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"swagger-api:master","ref":"master","sha":"34ec63e9080caf1aa891b03a0fcd40400ecf1ad5","user":{"login":"swagger-api","id":7658037,"avatar_url":"https://avatars.githubusercontent.com/u/7658037?v=3","gravatar_id":"","url":"https://api.github.com/users/swagger-api","html_url":"https://github.com/swagger-api","followers_url":"https://api.github.com/users/swagger-api/followers","following_url":"https://api.github.com/users/swagger-api/following{/other_user}","gists_url":"https://api.github.com/users/swagger-api/gists{/gist_id}","starred_url":"https://api.github.com/users/swagger-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagger-api/subscriptions","organizations_url":"https://api.github.com/users/swagger-api/orgs","repos_url":"https://api.github.com/users/swagger-api/repos","events_url":"https://api.github.com/users/swagger-api/events{/privacy}","received_events_url":"https://api.github.com/users/swagger-api/received_events","type":"Organization","site_admin":false},"repo":{"id":2006876,"name":"swagger-codegen","full_name":"swagger-api/swagger-codegen","owner":{"login":"swagger-api","id":7658037,"avatar_url":"https://avatars.githubusercontent.com/u/7658037?v=3","gravatar_id":"","url":"https://api.github.com/users/swagger-api","html_url":"https://github.com/swagger-api","followers_url":"https://api.github.com/users/swagger-api/followers","following_url":"https://api.github.com/users/swagger-api/following{/other_user}","gists_url":"https://api.github.com/users/swagger-api/gists{/gist_id}","starred_url":"https://api.github.com/users/swagger-api/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swagger-api/subscriptions","organizations_url":"https://api.github.com/users/swagger-api/orgs","repos_url":"https://api.github.com/users/swagger-api/repos","events_url":"https://api.github.com/users/swagger-api/events{/privacy}","received_events_url":"https://api.github.com/users/swagger-api/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swagger-api/swagger-codegen","description":"swagger-codegen contains a template-driven engine to generate client code in different languages by parsing your Swagger Resource Declaration.","fork":false,"url":"https://api.github.com/repos/swagger-api/swagger-codegen","forks_url":"https://api.github.com/repos/swagger-api/swagger-codegen/forks","keys_url":"https://api.github.com/repos/swagger-api/swagger-codegen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swagger-api/swagger-codegen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swagger-api/swagger-codegen/teams","hooks_url":"https://api.github.com/repos/swagger-api/swagger-codegen/hooks","issue_events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/events{/number}","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/events","assignees_url":"https://api.github.com/repos/swagger-api/swagger-codegen/assignees{/user}","branches_url":"https://api.github.com/repos/swagger-api/swagger-codegen/branches{/branch}","tags_url":"https://api.github.com/repos/swagger-api/swagger-codegen/tags","blobs_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/refs{/sha}","trees_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/{sha}","languages_url":"https://api.github.com/repos/swagger-api/swagger-codegen/languages","stargazers_url":"https://api.github.com/repos/swagger-api/swagger-codegen/stargazers","contributors_url":"https://api.github.com/repos/swagger-api/swagger-codegen/contributors","subscribers_url":"https://api.github.com/repos/swagger-api/swagger-codegen/subscribers","subscription_url":"https://api.github.com/repos/swagger-api/swagger-codegen/subscription","commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/commits{/sha}","git_commits_url":"https://api.github.com/repos/swagger-api/swagger-codegen/git/commits{/sha}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/comments{/number}","issue_comment_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments{/number}","contents_url":"https://api.github.com/repos/swagger-api/swagger-codegen/contents/{+path}","compare_url":"https://api.github.com/repos/swagger-api/swagger-codegen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swagger-api/swagger-codegen/merges","archive_url":"https://api.github.com/repos/swagger-api/swagger-codegen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swagger-api/swagger-codegen/downloads","issues_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues{/number}","pulls_url":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls{/number}","milestones_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones{/number}","notifications_url":"https://api.github.com/repos/swagger-api/swagger-codegen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels{/name}","releases_url":"https://api.github.com/repos/swagger-api/swagger-codegen/releases{/id}","deployments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/deployments","created_at":"2011-07-06T14:26:48Z","updated_at":"2016-05-08T21:19:57Z","pushed_at":"2016-05-09T00:25:43Z","git_url":"git://github.com/swagger-api/swagger-codegen.git","ssh_url":"git@github.com:swagger-api/swagger-codegen.git","clone_url":"https://github.com/swagger-api/swagger-codegen.git","svn_url":"https://github.com/swagger-api/swagger-codegen","homepage":"http://swagger.io","size":43400,"stargazers_count":2046,"watchers_count":2046,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1148,"mirror_url":null,"open_issues_count":343,"forks":1148,"open_issues":343,"watchers":2046,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794"},"html":{"href":"https://github.com/swagger-api/swagger-codegen/pull/2794"},"issue":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2794"},"comments":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2794/comments"},"review_comments":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794/comments"},"review_comment":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/pulls/2794/commits"},"statuses":{"href":"https://api.github.com/repos/swagger-api/swagger-codegen/statuses/4718c34984cc5a8915f8bf6db41ebd98fd001815"}}}}