nidi3 / raml-tester

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

queryParameters under securitySchemes is not recognized #23

Closed ghost closed 9 years ago

ghost commented 9 years ago

queryParameters defined under securityschemes is not picked up, so that test fails due to url parameter which is not present in raml.

Example:

Raml:

securitySchemes:
    - session:
        description: |
            Session authentication.
        describedBy:
            queryParameters:
                sessionId:
                    description: |
                       A session ID.
                    type: string
            responses:
                401:
                    description: |
                        An invalid session ID was given or the session is expired.
        type: x-session
...
/something/{id}:
  uriParameters: 
    id: 
      type: integer
      required: true
  get:
    securedBy: [session]

Request: http://localhost:8080/something/706?sessionId=1001

Resulting report: RamlReport{ requestViolations =[Query parameter 'sessionId' on action(GET /something/{id}) is not defined] responseViolations=[]}