{"action":"closed","number":1640,"pull_request":{"url":"https://api.github.com/repos/swagger-api/swagger-core/pulls/1640","id":57678000,"html_url":"https://github.com/swagger-api/swagger-core/pull/1640","diff_url":"https://github.com/swagger-api/swagger-core/pull/1640.diff","patch_url":"https://github.com/swagger-api/swagger-core/pull/1640.patch","issue_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1640","number":1640,"state":"closed","locked":false,"title":"issue-1318 - change Property.example from String to Object so number …","user":{"login":"etyrrill","id":12614146,"avatar_url":"https://avatars.githubusercontent.com/u/12614146?v=3","gravatar_id":"","url":"https://api.github.com/users/etyrrill","html_url":"https://github.com/etyrrill","followers_url":"https://api.github.com/users/etyrrill/followers","following_url":"https://api.github.com/users/etyrrill/following{/other_user}","gists_url":"https://api.github.com/users/etyrrill/gists{/gist_id}","starred_url":"https://api.github.com/users/etyrrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etyrrill/subscriptions","organizations_url":"https://api.github.com/users/etyrrill/orgs","repos_url":"https://api.github.com/users/etyrrill/repos","events_url":"https://api.github.com/users/etyrrill/events{/privacy}","received_events_url":"https://api.github.com/users/etyrrill/received_events","type":"User","site_admin":false},"body":"…and boolean fields are not represented as strings\r\n\r\nI have a class:\r\n\r\npublic class PasswordPolicy {\r\n    @ApiModelProperty(example = \"4\")\r\n    public int minPasswordLength;\r\n    @ApiModelProperty(example = \"true\")\r\n    public boolean requireMixedCase;\r\n    @ApiModelProperty(example = \"true\")\r\n    public boolean requireNumericChars;\r\n    @ApiModelProperty(example = \"true\")\r\n    public boolean requireSpecialChars;\r\n    @ApiModelProperty(example = \"true\")\r\n    public boolean passwordExpires;\r\n    @ApiModelProperty(example = \"90\")\r\n    public int maxPasswordAge;\r\n    @ApiModelProperty(example = \"3\")\r\n    public int lockAfterFailedAttempts;\r\n    @ApiModelProperty(example = \"2\")\r\n    public int lockPeriod;\r\n}\r\n\r\nWith the existing code my model schema looked like this:\r\n\r\n{\r\n  \"minPasswordLength\": \"4\",\r\n  \"requireMixedCase\": \"true\",\r\n  \"requireNumericChars\": \"true\",\r\n  \"requireSpecialChars\": \"true\",\r\n  \"passwordExpires\": \"true\",\r\n  \"maxPasswordAge\": \"90\",\r\n  \"lockAfterFailedAttempts\": \"3\",\r\n  \"lockPeriod\": \"2\"\r\n}\r\n\r\nWhile this works it is a bit misleading to users since it looks like these are string properties, not numeric or boolean.  With my code change the model schema becomes what you want it to be:\r\n\r\n{\r\n  \"minPasswordLength\": 4,\r\n  \"requireMixedCase\": true,\r\n  \"requireNumericChars\": true,\r\n  \"requireSpecialChars\": true,\r\n  \"passwordExpires\": true,\r\n  \"maxPasswordAge\": 90,\r\n  \"lockAfterFailedAttempts\": 3,\r\n  \"lockPeriod\": 2\r\n}\r\n\r\nYou still specify the example value in @ApiModelProperty as a String so those using the annotation don't need to change anything.","created_at":"2016-01-29T17:35:21Z","updated_at":"2016-02-03T23:34:52Z","closed_at":"2016-02-03T23:34:52Z","merged_at":"2016-02-03T23:34:52Z","merge_commit_sha":"fc4ea9e8fe097caef1f804627b34c7501484b214","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/swagger-api/swagger-core/pulls/1640/commits","review_comments_url":"https://api.github.com/repos/swagger-api/swagger-core/pulls/1640/comments","review_comment_url":"https://api.github.com/repos/swagger-api/swagger-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/1640/comments","statuses_url":"https://api.github.com/repos/swagger-api/swagger-core/statuses/a325b1e62aa87f1d9941cb90a091cbda4962194d","head":{"label":"etyrrill:issue-1318","ref":"issue-1318","sha":"a325b1e62aa87f1d9941cb90a091cbda4962194d","user":{"login":"etyrrill","id":12614146,"avatar_url":"https://avatars.githubusercontent.com/u/12614146?v=3","gravatar_id":"","url":"https://api.github.com/users/etyrrill","html_url":"https://github.com/etyrrill","followers_url":"https://api.github.com/users/etyrrill/followers","following_url":"https://api.github.com/users/etyrrill/following{/other_user}","gists_url":"https://api.github.com/users/etyrrill/gists{/gist_id}","starred_url":"https://api.github.com/users/etyrrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etyrrill/subscriptions","organizations_url":"https://api.github.com/users/etyrrill/orgs","repos_url":"https://api.github.com/users/etyrrill/repos","events_url":"https://api.github.com/users/etyrrill/events{/privacy}","received_events_url":"https://api.github.com/users/etyrrill/received_events","type":"User","site_admin":false},"repo":{"id":50645777,"name":"swagger-core","full_name":"etyrrill/swagger-core","owner":{"login":"etyrrill","id":12614146,"avatar_url":"https://avatars.githubusercontent.com/u/12614146?v=3","gravatar_id":"","url":"https://api.github.com/users/etyrrill","html_url":"https://github.com/etyrrill","followers_url":"https://api.github.com/users/etyrrill/followers","following_url":"https://api.github.com/users/etyrrill/following{/other_user}","gists_url":"https://api.github.com/users/etyrrill/gists{/gist_id}","starred_url":"https://api.github.com/users/etyrrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etyrrill/subscriptions","organizations_url":"https://api.github.com/users/etyrrill/orgs","repos_url":"https://api.github.com/users/etyrrill/repos","events_url":"https://api.github.com/users/etyrrill/events{/privacy}","received_events_url":"https://api.github.com/users/etyrrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/etyrrill/swagger-core","description":"Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API","fork":true,"url":"https://api.github.com/repos/etyrrill/swagger-core","forks_url":"https://api.github.com/repos/etyrrill/swagger-core/forks","keys_url":"https://api.github.com/repos/etyrrill/swagger-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/etyrrill/swagger-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/etyrrill/swagger-core/teams","hooks_url":"https://api.github.com/repos/etyrrill/swagger-core/hooks","issue_events_url":"https://api.github.com/repos/etyrrill/swagger-core/issues/events{/number}","events_url":"https://api.github.com/repos/etyrrill/swagger-core/events","assignees_url":"https://api.github.com/repos/etyrrill/swagger-core/assignees{/user}","branches_url":"https://api.github.com/repos/etyrrill/swagger-core/branches{/branch}","tags_url":"https://api.github.com/repos/etyrrill/swagger-core/tags","blobs_url":"https://api.github.com/repos/etyrrill/swagger-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/etyrrill/swagger-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/etyrrill/swagger-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/etyrrill/swagger-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/etyrrill/swagger-core/statuses/{sha}","languages_url":"https://api.github.com/repos/etyrrill/swagger-core/languages","stargazers_url":"https://api.github.com/repos/etyrrill/swagger-core/stargazers","contributors_url":"https://api.github.com/repos/etyrrill/swagger-core/contributors","subscribers_url":"https://api.github.com/repos/etyrrill/swagger-core/subscribers","subscription_url":"https://api.github.com/repos/etyrrill/swagger-core/subscription","commits_url":"https://api.github.com/repos/etyrrill/swagger-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/etyrrill/swagger-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/etyrrill/swagger-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/etyrrill/swagger-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/etyrrill/swagger-core/contents/{+path}","compare_url":"https://api.github.com/repos/etyrrill/swagger-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/etyrrill/swagger-core/merges","archive_url":"https://api.github.com/repos/etyrrill/swagger-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/etyrrill/swagger-core/downloads","issues_url":"https://api.github.com/repos/etyrrill/swagger-core/issues{/number}","pulls_url":"https://api.github.com/repos/etyrrill/swagger-core/pulls{/number}","milestones_url":"https://api.github.com/repos/etyrrill/swagger-core/milestones{/number}","notifications_url":"https://api.github.com/repos/etyrrill/swagger-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/etyrrill/swagger-core/labels{/name}","releases_url":"https://api.github.com/repos/etyrrill/swagger-core/releases{/id}","deployments_url":"https://api.github.com/repos/etyrrill/swagger-core/deployments","created_at":"2016-01-29T07:21:54Z","updated_at":"2016-01-29T07:21:56Z","pushed_at":"2016-01-29T07:48:16Z","git_url":"git://github.com/etyrrill/swagger-core.git","ssh_url":"git@github.com:etyrrill/swagger-core.git","clone_url":"https://github.com/etyrrill/swagger-core.git","svn_url":"https://github.com/etyrrill/swagger-core","homepage":"http://swagger.io","size":8442,"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":"60ae5fa878cec8a10b792fd1814aadea4241f9dd","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":2003641,"name":"swagger-core","full_name":"swagger-api/swagger-core","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-core","description":"Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API","fork":false,"url":"https://api.github.com/repos/swagger-api/swagger-core","forks_url":"https://api.github.com/repos/swagger-api/swagger-core/forks","keys_url":"https://api.github.com/repos/swagger-api/swagger-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swagger-api/swagger-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swagger-api/swagger-core/teams","hooks_url":"https://api.github.com/repos/swagger-api/swagger-core/hooks","issue_events_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/events{/number}","events_url":"https://api.github.com/repos/swagger-api/swagger-core/events","assignees_url":"https://api.github.com/repos/swagger-api/swagger-core/assignees{/user}","branches_url":"https://api.github.com/repos/swagger-api/swagger-core/branches{/branch}","tags_url":"https://api.github.com/repos/swagger-api/swagger-core/tags","blobs_url":"https://api.github.com/repos/swagger-api/swagger-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swagger-api/swagger-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swagger-api/swagger-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/swagger-api/swagger-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swagger-api/swagger-core/statuses/{sha}","languages_url":"https://api.github.com/repos/swagger-api/swagger-core/languages","stargazers_url":"https://api.github.com/repos/swagger-api/swagger-core/stargazers","contributors_url":"https://api.github.com/repos/swagger-api/swagger-core/contributors","subscribers_url":"https://api.github.com/repos/swagger-api/swagger-core/subscribers","subscription_url":"https://api.github.com/repos/swagger-api/swagger-core/subscription","commits_url":"https://api.github.com/repos/swagger-api/swagger-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/swagger-api/swagger-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/swagger-api/swagger-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/swagger-api/swagger-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/swagger-api/swagger-core/contents/{+path}","compare_url":"https://api.github.com/repos/swagger-api/swagger-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swagger-api/swagger-core/merges","archive_url":"https://api.github.com/repos/swagger-api/swagger-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swagger-api/swagger-core/downloads","issues_url":"https://api.github.com/repos/swagger-api/swagger-core/issues{/number}","pulls_url":"https://api.github.com/repos/swagger-api/swagger-core/pulls{/number}","milestones_url":"https://api.github.com/repos/swagger-api/swagger-core/milestones{/number}","notifications_url":"https://api.github.com/repos/swagger-api/swagger-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swagger-api/swagger-core/labels{/name}","releases_url":"https://api.github.com/repos/swagger-api/swagger-core/releases{/id}","deployments_url":"https://api.github.com/repos/swagger-api/swagger-core/deployments","created_at":"2011-07-05T23:44:11Z","updated_at":"2016-02-03T13:17:14Z","pushed_at":"2016-02-03T23:34:52Z","git_url":"git://github.com/swagger-api/swagger-core.git","ssh_url":"git@github.com:swagger-api/swagger-core.git","clone_url":"https://github.com/swagger-api/swagger-core.git","svn_url":"https://github.com/swagger-api/swagger-core","homepage":"http://swagger.io","size":11270,"stargazers_count":3118,"watchers_count":3118,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1059,"mirror_url":null,"open_issues_count":98,"forks":1059,"open_issues":98,"watchers":3118,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swagger-api/swagger-core/pulls/1640"},"html":{"href":"https://github.com/swagger-api/swagger-core/pull/1640"},"issue":{"href":"https://api.github.com/repos/swagger-api/swagger-core/issues/1640"},"comments":{"href":"https://api.github.com/repos/swagger-api/swagger-core/issues/1640/comments"},"review_comments":{"href":"https://api.github.com/repos/swagger-api/swagger-core/pulls/1640/comments"},"review_comment":{"href":"https://api.github.com/repos/swagger-api/swagger-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swagger-api/swagger-core/pulls/1640/commits"},"statuses":{"href":"https://api.github.com/repos/swagger-api/swagger-core/statuses/a325b1e62aa87f1d9941cb90a091cbda4962194d"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"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},"comments":0,"review_comments":0,"commits":1,"additions":72,"deletions":11,"changed_files":9}}