nidi3 / raml-tester

Test if a request/response matches a given raml definition
Apache License 2.0
71 stars 14 forks source link

NPE in SecurityExtractor when using `null` security scheme #31

Closed ddossot closed 9 years ago

ddossot commented 9 years ago

Per RAML spec:

To indicate that the method may be called without applying any securityScheme, the method may be annotated with the null securityScheme. ... securedBy: [null, oauth_2_0]

When adding null to the array of security types, I get:

java.lang.NullPointerException
    at guru.nidi.ramltester.core.SecurityExtractor.queryParameters(SecurityExtractor.java:46)
    at guru.nidi.ramltester.core.RamlChecker.checkQueryParameters(RamlChecker.java:146)
    at guru.nidi.ramltester.core.RamlChecker.checkRequest(RamlChecker.java:112)
    at guru.nidi.ramltester.core.RamlChecker.check(RamlChecker.java:68)
nidi3 commented 9 years ago

Your most probably right, I'll have a look at it as soon as I have time (currently at holidays)

ddossot commented 9 years ago

Happy to confirm this is now fixed in 0.8.1 :+1: