{"action":"created","issue":{"url":"https://api.github.com/repos/springfox/springfox/issues/356","labels_url":"https://api.github.com/repos/springfox/springfox/issues/356/labels{/name}","comments_url":"https://api.github.com/repos/springfox/springfox/issues/356/comments","events_url":"https://api.github.com/repos/springfox/springfox/issues/356/events","html_url":"https://github.com/springfox/springfox/issues/356","id":37400060,"number":356,"title":"Support for JSR-303 (Java Bean Validation) ?","user":{"login":"omayevskiy","id":3081911,"avatar_url":"https://avatars.githubusercontent.com/u/3081911?v=3","gravatar_id":"","url":"https://api.github.com/users/omayevskiy","html_url":"https://github.com/omayevskiy","followers_url":"https://api.github.com/users/omayevskiy/followers","following_url":"https://api.github.com/users/omayevskiy/following{/other_user}","gists_url":"https://api.github.com/users/omayevskiy/gists{/gist_id}","starred_url":"https://api.github.com/users/omayevskiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omayevskiy/subscriptions","organizations_url":"https://api.github.com/users/omayevskiy/orgs","repos_url":"https://api.github.com/users/omayevskiy/repos","events_url":"https://api.github.com/users/omayevskiy/events{/privacy}","received_events_url":"https://api.github.com/users/omayevskiy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/springfox/springfox/labels/feature","name":"feature","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/springfox/springfox/milestones/34","html_url":"https://github.com/springfox/springfox/milestones/2.3.0","labels_url":"https://api.github.com/repos/springfox/springfox/milestones/34/labels","id":1249355,"number":34,"title":"2.3.0","description":"","creator":{"login":"dilipkrish","id":73257,"avatar_url":"https://avatars.githubusercontent.com/u/73257?v=3","gravatar_id":"","url":"https://api.github.com/users/dilipkrish","html_url":"https://github.com/dilipkrish","followers_url":"https://api.github.com/users/dilipkrish/followers","following_url":"https://api.github.com/users/dilipkrish/following{/other_user}","gists_url":"https://api.github.com/users/dilipkrish/gists{/gist_id}","starred_url":"https://api.github.com/users/dilipkrish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dilipkrish/subscriptions","organizations_url":"https://api.github.com/users/dilipkrish/orgs","repos_url":"https://api.github.com/users/dilipkrish/repos","events_url":"https://api.github.com/users/dilipkrish/events{/privacy}","received_events_url":"https://api.github.com/users/dilipkrish/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":0,"state":"open","created_at":"2015-08-11T03:11:58Z","updated_at":"2015-08-11T03:50:07Z","due_on":null,"closed_at":null},"comments":8,"created_at":"2014-07-08T18:38:46Z","updated_at":"2015-08-11T12:29:10Z","closed_at":null,"body":"Hi is there any support for JSR-303 (Java Bean Validation) ?\r\n\r\nGiven\r\n\r\nA controller method\r\n```\r\nimport javax.validation.Valid;\r\n@RequestMapping(method = RequestMethod.PUT)\r\n    public void create( @RequestBody @Valid MyDTO myDTO) {\r\n        // do something with myDTO\r\n    }\r\n```\r\n\r\nA command object\r\n```\r\nimport javax.validation.constraints.NotNull;\r\npublic class MyDTO {\r\n\r\n    @NotNull\r\n    private Long myId;\r\n\r\n    @NotNull\r\n    private String myValue;\r\n```\r\n\r\nSwagger produces\r\n```\r\nMyDTO {\r\n   myId (integer, optional),\r\n   myValue (string, optional)\r\n}\r\n```\r\n\r\nBut should be\r\n\r\n```\r\nMyDTO {\r\n   myId (long?, required),\r\n   myValue (string, required)\r\n}\r\n```\r\n\r\nI could add swagger annotations to MyDTO's fields, but then the NotNull/required logic would be duplicated and potentially leads to documentation inconsistence.\r\n\r\nThx for reading ;-)"},"comment":{"url":"https://api.github.com/repos/springfox/springfox/issues/comments/129857038","html_url":"https://github.com/springfox/springfox/issues/356#issuecomment-129857038","issue_url":"https://api.github.com/repos/springfox/springfox/issues/356","id":129857038,"user":{"login":"NarendraPeddineni","id":13015931,"avatar_url":"https://avatars.githubusercontent.com/u/13015931?v=3","gravatar_id":"","url":"https://api.github.com/users/NarendraPeddineni","html_url":"https://github.com/NarendraPeddineni","followers_url":"https://api.github.com/users/NarendraPeddineni/followers","following_url":"https://api.github.com/users/NarendraPeddineni/following{/other_user}","gists_url":"https://api.github.com/users/NarendraPeddineni/gists{/gist_id}","starred_url":"https://api.github.com/users/NarendraPeddineni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NarendraPeddineni/subscriptions","organizations_url":"https://api.github.com/users/NarendraPeddineni/orgs","repos_url":"https://api.github.com/users/NarendraPeddineni/repos","events_url":"https://api.github.com/users/NarendraPeddineni/events{/privacy}","received_events_url":"https://api.github.com/users/NarendraPeddineni/received_events","type":"User","site_admin":false},"created_at":"2015-08-11T12:29:10Z","updated_at":"2015-08-11T12:29:10Z","body":"Hi is there any support for JSR-303 (Java Bean Validation) ?"}}