Skip to main content

all-required-parameters-present-in-request

Overview

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

A parameter may be marked as required at any level in the OpenAPI operation definition. When defining the test case request, a value for all such parameters must be present in one of the request's uri, headers or body sections depending upon the parameter's location set in the operation. This value must be non-empty and non-null.

PropertyValue
EnabledYes
Maximum SeverityError
MessageValue for required parameter is not provided in the request.
CodeAPIMATICGAVEL_V006
TypeValidation
Rule SystemSemantic
Broad CategoryGavel Request
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsgavel apimatic semantic validation value required parameter request operation

Suggested Fixes

  • Ensure that if a parameter is marked as required using the required property in an opertaion, its value is set in the relevant section of the test case request.
  • Ensure that the value provided for the parameter is not empty or null.
  • Ensure that the value of the parameter is provided in the correct section of the test case request depending upon its location defined in the operation.
  • Value of the operation level query and path parameters must be set in the uri section of the test case request.
  • Value of the operation level header parameters must be set in the headers section of the test case request.
  • Value for parameters from the operation request body content section or body/formData parameters list must be set in the body section of the test case request.
  • Ensure that the name of the parameter in the test case matches exactly with the operation level parameter name and has no typos.
  • Parameter names are compared in a case-sensitive manner.

For More Information