{"action":"created","issue":{"url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/421","repository_url":"https://api.github.com/repos/apigee-127/swagger-tools","labels_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/421/labels{/name}","comments_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/421/comments","events_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/421/events","html_url":"https://github.com/apigee-127/swagger-tools/issues/421","id":174631994,"number":421,"title":"default is not working-","user":{"login":"SameerSiddiqui","id":7409374,"avatar_url":"https://avatars.githubusercontent.com/u/7409374?v=3","gravatar_id":"","url":"https://api.github.com/users/SameerSiddiqui","html_url":"https://github.com/SameerSiddiqui","followers_url":"https://api.github.com/users/SameerSiddiqui/followers","following_url":"https://api.github.com/users/SameerSiddiqui/following{/other_user}","gists_url":"https://api.github.com/users/SameerSiddiqui/gists{/gist_id}","starred_url":"https://api.github.com/users/SameerSiddiqui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SameerSiddiqui/subscriptions","organizations_url":"https://api.github.com/users/SameerSiddiqui/orgs","repos_url":"https://api.github.com/users/SameerSiddiqui/repos","events_url":"https://api.github.com/users/SameerSiddiqui/events{/privacy}","received_events_url":"https://api.github.com/users/SameerSiddiqui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-01T21:36:46Z","updated_at":"2016-09-01T22:59:56Z","closed_at":null,"body":"```\r\n country:\r\n        type: string\r\n        maxLength: 10\r\n        default: \"US\"\r\nrequired:\r\n - country\r\n```\r\nThe above is in my swagger.yaml\r\n\r\nWith the below object- I do get required error-\r\n\r\n`{\r\n\"id\": \"030688B0-7060-11E6-A02E-0050569C3256\",\r\n\"name\": \"Home Address\",\r\n\"type\": \"HOME\",\r\n\"street\": \"416 RED RIVER TRL\",\r\n\"city\": \"IRVING\",\r\n\"state\": \"TX\",\r\n\"postalCode\": \"75063-4523\"\r\n\t\t\t}`\r\n\r\nBut with this object- default doesn't even kicks in and sends empty.\r\n\r\n\r\n``{\r\n\"id\": \"030688B0-7060-11E6-A02E-0050569C3256\",\r\n\"name\": \"Home Address\",\r\n\"type\": \"HOME\",\r\n\"street\": \"416 RED RIVER TRL\",\r\n\"city\": \"IRVING\",\r\n\"state\": \"TX\",\r\n\"country\":\"\",\r\n\"postalCode\": \"75063-4523\"\r\n}``\r\n\r\ndefault and required are kind of contradicting each other. What is the proper implementation ?  This seems to be a bug. \r\n\r\nIf the country is required- and the key is not present. it kicks in, but with empty value default doesn't kicks in.  \r\n\r\nEven if i remove country from required- Default doesn't kicks in.\r\n\r\nThanks for the help."},"comment":{"url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/comments/244237792","html_url":"https://github.com/apigee-127/swagger-tools/issues/421#issuecomment-244237792","issue_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/421","id":244237792,"user":{"login":"whitlockjc","id":98899,"avatar_url":"https://avatars.githubusercontent.com/u/98899?v=3","gravatar_id":"","url":"https://api.github.com/users/whitlockjc","html_url":"https://github.com/whitlockjc","followers_url":"https://api.github.com/users/whitlockjc/followers","following_url":"https://api.github.com/users/whitlockjc/following{/other_user}","gists_url":"https://api.github.com/users/whitlockjc/gists{/gist_id}","starred_url":"https://api.github.com/users/whitlockjc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitlockjc/subscriptions","organizations_url":"https://api.github.com/users/whitlockjc/orgs","repos_url":"https://api.github.com/users/whitlockjc/repos","events_url":"https://api.github.com/users/whitlockjc/events{/privacy}","received_events_url":"https://api.github.com/users/whitlockjc/received_events","type":"User","site_admin":false},"created_at":"2016-09-01T22:59:56Z","updated_at":"2016-09-01T22:59:56Z","body":"Well, the JSON Schema should _just work_ without the value being provided if you have a `default` value...as in you should not fail request validation.  Now...swagger-tools **will not** alter your request body to have the default values within it.  Is that what you're expecting that isn't happening?"}}
{"actor":{"display_login":"whitlockjc"}}