What is the reason for not failing a validation for an extra query parameter?
Issue #102
resolved
Hi, what was the reasoning for not failing a validation if an extra query parameter is supplied that is not defined as part of the swagger document for an endpoint?
Regards, Andrew
Comments (3)
-
-
Account Deleted reporter Hi James, that would be awesome if you could add a check for that case.
-
- changed status to resolved
Raised
#109to track adding a new check for this case - Log in to comment
Hi Andrew - thanks for the question.
The thinking here is that most services will simply ignore query params they don't know/care about, and so sending a request with additional query params doesn't necessarily constitute an invalid request.
Thinking about it though, I can see a case for wanting to fail validation in tests in this scenario (e.g. your service used to accept a query param but it was accidentally removed during a refactoring and you want to know about that change in your test suite).
I would be happy to add a check for this case, but would probably make it an
INFO
level message by default (giving you the option to change it to anERROR
if it was needed).Cheers, James