Skip to main content

no-request-body-in-resource-get-method

Overview

This rule belongs to the api-blueprint-validation ruleset and states that:

A resource in an API Blueprint/Elements file must not define an Attributes or a Payload section for the request when the actions use the GET HTTP method. This is because such methods do not expect a body and, therefore, all related information will be automatically ignored during import/transformations in APIMatic.

PropertyValue
EnabledYes
Maximum SeverityWarning
MessageAn attributes or a request payload section is defined for a GET method.
CodeAPIBLUEPRINT_V100
TypeValidation
Rule SystemSemantic
Broad CategoryAPI Resources
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsapi blueprint api elements api semantic validation get action http body request

Suggested Fixes

  • If an Attributes section is defined for the GET action, remove it.
  • If a Request section is defined, remove any Attributes or Body or Schema sections from it.

For More Information