no-request-payload-with-get-method
Overview
This rule belongs to the postman-validation ruleset and states that:
A request that uses method GET must not define a payload. This means that for Postman Collections v1.0, sending the payload should either be disabled using the request's dataDisabled flag or properties data, rawModeData and dataMode must not be set. Similarly, for Postman Collections v2.0 or above, property body in the request should either not be set or it should be disabled using the body object level disabled flag. This is because such methods do not expect a body and, therefore, all related information will be ignored automatically during import/transformations in APIMatic.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Warning |
| Message | Request uses method GET but has defined a payload. |
| Code | POSTMAN_V356 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Requests |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | postman api semantic validation payload data body get method request |
Suggested Fixes
- If you are using Postman Collections v1.0, remove property definitions of
data,rawModeData,dataModefrom the request definition. - If you are using Postman Collections v1.0 and wish to retain the payload definition, you can also simply set property
dataDisabledtotruein the request definition. - If you are using Postman Collections v2.0 and above, remove definition of property
bodyfrom the request definition. - If you are using Postman Collections v2.0 and above and wish to retain the body definition, then simply set
disabledflag totruein the body definition. - In the Postman application, open the
Bodysection of your request and selectnoneor an equivalent option from the list. Save and export your file again.
For More Information
- https://learning.postman.com/collection-format/getting-started/structure-of-a-collection/#request
- https://learning.postman.com/docs/sending-requests/requests/
- https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html
- https://schema.postman.com/collection/json/v2.1.0/draft-07/collection.json
- https://schema.postman.com/collection/json/v2.0.0/draft-07/docs/index.html
- https://schema.postman.com/collection/json/v2.0.0/draft-07/collection.json
- https://schema.postman.com/collection/json/v1.0.0/draft-07/docs/index.html
- https://schema.postman.com/collection/json/v1.0.0/draft-07/collection.json
- https://learning.postman.com/docs/introduction/overview/
- https://docs.apimatic.io/rulesets/overview/