Skip to main content

valid-type-of-request-parameter-value

Overview

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

When a request parameter value is set in one of the uri/headers/body sections, the value's type must be valid against the schema/type definition present for that parameter in the corresponding operation, for which the test case is defined.

PropertyValue
EnabledYes
Maximum SeverityError
MessageRequest parameter value does not use a valid type as per the definition provided in the corresponding operation.
CodeAPIMATICGAVEL_V005
TypeValidation
Rule SystemSemantic
Broad CategoryGavel Request
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsgavel apimatic semantic validation schema type value parameter request operation

Suggested Fixes

  • Analyze the constraints specified for the parameter in the operation parameter schema definition and ensure all the constraints are satisfied.
  • If an array is expected, ensure that your value is surrounded by square brackets [ and ].
  • If an array is not expected, ensure that your value contains a single item only and is not surrounded by square brackets [ and ].
  • If a numeric value is expected, ensure that your value is a valid number and it is not surrounded by single or double quotes.
  • If a string value is expected, ensure that it is escaped properly and surrounded by quotes if necessary.
  • If an object is expected, ensure that your value is a key-value map.

For More Information