get-method-cannot-have-body
Overview
This rule belongs to the raml-validation ruleset and states that:
If a resource defines a get method, the method must not define a body section as 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 | Get method has a body defined. |
| Code | RAML_V400 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Resources and Methods |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | raml semantic validation body get method resource |
Suggested Fixes
- Remove the
bodysection from the method definition marked asgetin the resource.
For More Information
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#bodies
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#methods
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md#resource-property
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#body
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#methods
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md#resources-and-nested-resources
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-10/raml-10.md
- https://github.com/raml-org/raml-spec/blob/master/versions/raml-08/raml-08.md
- https://docs.apimatic.io/rulesets/overview/