java.lang.NullPointerException on Security Object in Swagger file
Issue #188
resolved
Hi !
I have an issue while using your library, it seems that when I am trying to had a security rule on my swagger I got an java.lang.NullPointerException. I did several tests to be sure that the problem was the security object on the swagger and it is. When I remove it from my swagger it's working. Is anyone has an way to solve this bug ? I add a minimal version of the swagger that I am issuing with.
Best Regards,
Happy Holidays !
Comments (3)
-
-
- changed status to open
-
- changed status to resolved
Fixed in v2.2.1
- Log in to comment
Thanks for raising this. I was able to reproduce the NPE with your example.
It appears the root cause is that your spec is missing a
securitySchemes
definition, which is required when using thesecurity
keyword - see https://swagger.io/docs/specification/authentication/The NPE is because the validator expects the
securitySchemes
to be present and doesn't guard against the case where its missing.I will update the validator emit a warning or logging etc in this case (it is actually the spec that has the validation problem, not the request).