java.lang.NullPointerException on Security Object in Swagger file

Issue #188 resolved
Former user created an issue

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)

  1. James Navin

    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 the security 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).

  2. Log in to comment