Skip to main content

pre-defined-operation-parameter-for-request-query-param

Overview

This rule belongs to the apimatic-gavel-validation ruleset and states that:

When defining a query string in the request uri property, each parameter whose value is set in the query string must also be defined in the corresponding operation for which the test case is being defined.

PropertyValue
EnabledYes
Maximum SeverityError
MessageRequest query parameter is not defined in the corresponding operation.
CodeAPIMATICGAVEL_V002
TypeValidation
Rule SystemSemantic
Broad CategoryGavel Request
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsgavel apimatic semantic validation parameter query request operation

Suggested Fixes

  • In /pets?pet-id=1, pet-id=1 is a query string and pet-id is the name of the query parameter.
  • The name of the query parameter in the request uri must match exactly with a parameter defined in the operation's parameters list.
  • The operation level parameter with equal name must have its location in set as query.
  • Ensure that the query string parameter name and the operation level parameter name matches exactly with no typos.
  • Parameter names are compared in a case-sensitive manner.

For More Information