{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1781","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1781/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1781/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1781/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/1781","id":124229307,"number":1781,"title":"akka-scala implemention NPE on spec with no securityDefinitions property","user":{"login":"andylowry","id":108675,"avatar_url":"https://avatars.githubusercontent.com/u/108675?v=3","gravatar_id":"","url":"https://api.github.com/users/andylowry","html_url":"https://github.com/andylowry","followers_url":"https://api.github.com/users/andylowry/followers","following_url":"https://api.github.com/users/andylowry/following{/other_user}","gists_url":"https://api.github.com/users/andylowry/gists{/gist_id}","starred_url":"https://api.github.com/users/andylowry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andylowry/subscriptions","organizations_url":"https://api.github.com/users/andylowry/orgs","repos_url":"https://api.github.com/users/andylowry/repos","events_url":"https://api.github.com/users/andylowry/events{/privacy}","received_events_url":"https://api.github.com/users/andylowry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-29T15:51:34Z","updated_at":"2015-12-29T16:28:03Z","closed_at":null,"body":"Seen in release 2.1.4, and in latest commit on master branch: 564f6e2bb5ff22bdf08672c103c5a14dffdef60a\r\n\r\nIn the `fromSecurity` method override in `AkkaScalaClientCodegen`, the iterator that looks for an OAuth security definition fails with NPE if the spec contains no `securityDefinitions` property.\r\n\r\nThe superclass method explicitly returns null in this case, and that null value is used by the akka-scala module, leading to the NPE.\r\n\r\nTo reproduce this, remove (not just empty out) the `securityDefinitions` property in petstore (and remove all `security` properties, where the removed definitions are referenced).\r\n\r\nPossible fixes include:\r\n\r\n1. Check for null in `AkkaScalaClientCodegen#fromSecurity`\r\n2. Return an empty list in `DefaultCodegen#fromSecurity` instead of null\r\n\r\nLatter seems preferable to me, since an empty list should have the same meaning as omitting the `securityDefinitions` property, and it would prevent others from falling into the same trap in the future."},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/167825540","html_url":"https://github.com/swagger-api/swagger-codegen/issues/1781#issuecomment-167825540","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/1781","id":167825540,"user":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"created_at":"2015-12-29T16:28:03Z","updated_at":"2015-12-29T16:28:03Z","body":"@andylowry thanks for the detailed issue report. We'll look into this and get back to you."}}