{"action":"closed","issue":{"url":"https://api.github.com/repos/springfox/springfox/issues/2276","repository_url":"https://api.github.com/repos/springfox/springfox","labels_url":"https://api.github.com/repos/springfox/springfox/issues/2276/labels{/name}","comments_url":"https://api.github.com/repos/springfox/springfox/issues/2276/comments","events_url":"https://api.github.com/repos/springfox/springfox/issues/2276/events","html_url":"https://github.com/springfox/springfox/issues/2276","id":301904859,"number":2276,"title":"@RequestParam with defaultValue of empty string on String parameter marked as required","user":{"login":"matthewmcgarvey","id":17329408,"avatar_url":"https://avatars0.githubusercontent.com/u/17329408?v=4","gravatar_id":"","url":"https://api.github.com/users/matthewmcgarvey","html_url":"https://github.com/matthewmcgarvey","followers_url":"https://api.github.com/users/matthewmcgarvey/followers","following_url":"https://api.github.com/users/matthewmcgarvey/following{/other_user}","gists_url":"https://api.github.com/users/matthewmcgarvey/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewmcgarvey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewmcgarvey/subscriptions","organizations_url":"https://api.github.com/users/matthewmcgarvey/orgs","repos_url":"https://api.github.com/users/matthewmcgarvey/repos","events_url":"https://api.github.com/users/matthewmcgarvey/events{/privacy}","received_events_url":"https://api.github.com/users/matthewmcgarvey/received_events","type":"User","site_admin":false},"labels":[{"id":4478202,"url":"https://api.github.com/repos/springfox/springfox/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-02T21:05:59Z","updated_at":"2018-03-05T12:01:11Z","closed_at":"2018-03-05T12:01:11Z","author_association":"NONE","body":"Came across a query parameter showing that it is required when, in the spring controller, it has a defaultValue of an empty string.  Looking through the repository, I see that defaultValue sans required false is supported but the code is checking to see if the string is not blank in addition to checking if the value is not the `DEFAULT_NONE` that is the actual default value on that field.\r\n\r\nMy contention is that any value other than `DEFAULT_NONE` should be considered valid.\r\n\r\nExample that creates the bug:\r\n```java\r\n@GetMapping\r\npublic String search(@RequestParam(defaultValue = \"\") String email) {\r\n    // The Request Param is implicitly not required because of the defaultValue (which is handled\r\n    // by springfox), but the defaultValue is an empty string to avoid null checks\r\n    System.out.println(\"Email should be an empty string if not provided: \" + email);\r\n    return email;\r\n}\r\n```\r\nFile To Change: https://github.com/springfox/springfox/blob/master/springfox-spring-web/src/main/java/springfox/documentation/spring/web/readers/parameter/ParameterRequiredReader.java"}}
{"actor":{"display_login":"dilipkrish"}}