{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/966","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/966/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/966/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/966/events","html_url":"https://github.com/swagger-api/swagger-ui/issues/966","id":59033079,"number":966,"title":"Boolean body parameters cause JS error","user":{"login":"phindmarsh","id":344000,"avatar_url":"https://avatars.githubusercontent.com/u/344000?v=3","gravatar_id":"","url":"https://api.github.com/users/phindmarsh","html_url":"https://github.com/phindmarsh","followers_url":"https://api.github.com/users/phindmarsh/followers","following_url":"https://api.github.com/users/phindmarsh/following{/other_user}","gists_url":"https://api.github.com/users/phindmarsh/gists{/gist_id}","starred_url":"https://api.github.com/users/phindmarsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phindmarsh/subscriptions","organizations_url":"https://api.github.com/users/phindmarsh/orgs","repos_url":"https://api.github.com/users/phindmarsh/repos","events_url":"https://api.github.com/users/phindmarsh/events{/privacy}","received_events_url":"https://api.github.com/users/phindmarsh/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/milestones/5","html_url":"https://github.com/swagger-api/swagger-ui/milestones/v2.1-M2","labels_url":"https://api.github.com/repos/swagger-api/swagger-ui/milestones/5/labels","id":916898,"number":5,"title":"v2.1-M2","description":"Add support for:\r\n\r\nMaps\r\nComposition\r\nEnums\r\n","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":0,"closed_issues":77,"state":"closed","created_at":"2014-12-29T18:05:17Z","updated_at":"2015-06-15T13:22:14Z","due_on":"2015-03-22T07:00:00Z","closed_at":"2015-06-15T13:22:14Z"},"comments":14,"created_at":"2015-02-26T07:47:54Z","updated_at":"2015-06-19T15:44:12Z","closed_at":"2015-03-18T19:42:23Z","body":"I've been working on generating swagger schemas and noticed that an operation that uses a boolean parameter in the body will cause a Javascript error `Cannot read property 'toLowerCase' of undefined`.\r\n\r\nThis seems to happen because the handlebars helper `isArray` (declared in `ParameterView.prototype.initialize`) is calling `toLowerCase()` on the parameter `type` without checking it isn't undefined first. Since body parameters have the `type` defined in `schema`, I figure this is a bug. The validator badge shows that the schema itself is valid, but the UI will fail to render.\r\n\r\nIf I put a `\"type\": \"boolean\"` property onto the parameter (which is not valid) then it will render properly\r\n\r\nI've attached two different schemas:\r\n- [Error causing schema](https://gist.githubusercontent.com/phindmarsh/d3b3672936c19eb66dbe/raw/34fcf704742d64d10397fdef0dd923b6cc442c81/valid-but-broken.json), this is the one that should work, but fails.\r\n- [Working schema](https://gist.githubusercontent.com/phindmarsh/d3b3672936c19eb66dbe/raw/85be8a42695472caa7e53fbc10e5ead00f3738c9/invalid-but-works.json), this one renders properly, but is not a valid schema (due to the `type` property being directly on the schema).\r\n\r\nIs it appropriate to make the handlebars function check the type is not undefined first? I suspect there's something more going on here since it only seems to affect boolean parameters.\r\n\r\nThis is in Chrome Version 40.0.2214.115 (64-bit) on OS X 10.10.2"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/comments/113553251","html_url":"https://github.com/swagger-api/swagger-ui/issues/966#issuecomment-113553251","issue_url":"https://api.github.com/repos/swagger-api/swagger-ui/issues/966","id":113553251,"user":{"login":"webron","id":241629,"avatar_url":"https://avatars.githubusercontent.com/u/241629?v=3","gravatar_id":"","url":"https://api.github.com/users/webron","html_url":"https://github.com/webron","followers_url":"https://api.github.com/users/webron/followers","following_url":"https://api.github.com/users/webron/following{/other_user}","gists_url":"https://api.github.com/users/webron/gists{/gist_id}","starred_url":"https://api.github.com/users/webron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webron/subscriptions","organizations_url":"https://api.github.com/users/webron/orgs","repos_url":"https://api.github.com/users/webron/repos","events_url":"https://api.github.com/users/webron/events{/privacy}","received_events_url":"https://api.github.com/users/webron/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T15:44:11Z","updated_at":"2015-06-19T15:44:11Z","body":"@jdamick, @mohsen1, @wing328 - there seems to be some confusion here. `body` parameters *may* have the `required` property included and set whichever way. If it is not, included, `false` is assumed. This is specified by the spec.\r\n\r\n@jdamick - the definition you provide is valid and should work. If you experience an issue with the *latest* swagger-ui version (2.1.0 at the moment), please open a new ticket. "}}