Skip to main content

no-additional-request-parameter

Overview

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

A test case request parameter whose value may be set in one of the uri, headers or body sections must also be pre-defined in the corresponding operation at the appropriate location. Any parameter which is not pre-defined and its value is specified in the test case will be ignored.

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

Suggested Fixes

  • If the parameter is not expected to be part of the operation, remove the extra parameter value from the test case request.
  • Ensure that the name of the parameter in the test case matches exactly with an operation level parameter name and has no typos.
  • Parameter names are compared in a case-sensitive manner.
  • If the parameter is not yet defined in the operation, add a definition for it at the appropriate location.
  • Query string parameters whose value is set in the uri section need to be defined in the operation parameters list using location in set as query.
  • Header parameters whose value is set in the headers section need to be defined in the operation parameters list using location in set as header. This does not, however, apply for Accept or Content-Type headers.
  • Body parameter(s) definined in the body section need to be defined in the operation's requestBody content section (for OpenAPI v3.0 and above) or parameters list with location in set as body/formData (for OpenAPI v2.0).

For More Information