{"action":"created","issue":{"url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/232","labels_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/232/comments","events_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/232/events","html_url":"https://github.com/apigee-127/swagger-tools/issues/232","id":88557326,"number":232,"title":"better error message for unexpected response type","user":{"login":"reesew","id":1163161,"avatar_url":"https://avatars.githubusercontent.com/u/1163161?v=3","gravatar_id":"","url":"https://api.github.com/users/reesew","html_url":"https://github.com/reesew","followers_url":"https://api.github.com/users/reesew/followers","following_url":"https://api.github.com/users/reesew/following{/other_user}","gists_url":"https://api.github.com/users/reesew/gists{/gist_id}","starred_url":"https://api.github.com/users/reesew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reesew/subscriptions","organizations_url":"https://api.github.com/users/reesew/orgs","repos_url":"https://api.github.com/users/reesew/repos","events_url":"https://api.github.com/users/reesew/events{/privacy}","received_events_url":"https://api.github.com/users/reesew/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-15T22:29:34Z","updated_at":"2015-07-09T18:02:45Z","closed_at":null,"body":"When validating responses, if a response code is returned which doesn't match one in the spec, and `default` isn't defined, the resulting error is confusing: \r\n\r\n```\r\nStack: TypeError: Cannot read property 'type' of undefined\r\n    at Object.isModelParameter (/var/www/node_modules/swagger-tools/middleware/helpers.js:55:14)\r\n    at validateValue (/var/www/node_modules/swagger-tools/middleware/swagger-validator.js:91:26)\r\n    at ServerResponse.end (/var/www/node_modules/swagger-tools/middleware/swagger-validator.js:210:7)\r\n    at ServerResponse.send (/var/www/node_modules/express/lib/response.js:195:10)\r\n    at ServerResponse.json (/var/www/node_modules/express/lib/response.js:240:15)\r\n```\r\n\r\nFor example, when only a 200 response is defined for 'PUT /pets', when the validator encounters a 201 response, it should say something about no `201` or `default` response being defined in the swagger object/swagger.json"},"comment":{"url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/comments/120088414","html_url":"https://github.com/apigee-127/swagger-tools/issues/232#issuecomment-120088414","issue_url":"https://api.github.com/repos/apigee-127/swagger-tools/issues/232","id":120088414,"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":"2015-07-09T18:02:45Z","updated_at":"2015-07-09T18:02:45Z","body":"So basically if there is no `default` response and we cannot find the proper response based on the HTTP verb, just say so in an error instead of assuming we found one?"}}