Skip to main content

no-body-or-form-parameter-in-get-method-operation

Overview

This rule belongs to the swagger-v1-validation ruleset and states that:

An operation with GET method must not define a parameter with paramType set as body or form in the parameters list. This is because such methods do not expect a request body and, therefore, all related information will be automatically ignored during import/transformations in APIMatic.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageBody/Form parameter found in operation with GET method.
CodeSWAGGER1_V502
TypeValidation
Rule SystemSemantic
Broad CategoryOperations
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsswagger1 swagger semantic validation get body form parameter operation request body

Suggested Fixes

  • Remove all parameters with paramType set as body or form from the parameters list of the Operation Object with GET method.
  • Change the operation method to POST or any other method that supports a request body.

For More Information