phoenixnap / springmvc-raml-plugin

Spring MVC - RAML Spec Synchroniser Plugin. A Maven plugin designed to Generate Server & Client code in Spring from a RAML API descriptor and conversely, a RAML API document from the SpringMVC Server implementation.
Apache License 2.0
136 stars 84 forks source link

@Delete does not generate body parameter #235

Closed ghost closed 6 years ago

ghost commented 6 years ago

Using this definition

delete:
        body:
          application/json:
            type: <<some complex type here>>

the expected result was

@RequestMapping(value = "/", method = RequestMethod.DELETE)
    public ResponseEntity<?> delete(ComplexObject body);

but it was

@RequestMapping(value = "/", method = RequestMethod.DELETE)
    public ResponseEntity<?> delete();

the goal is to send a list of ids to perform a batch deleted. Maybe my RAML definition is wrong?

stojsavljevic commented 6 years ago

Usually (according to RESTful guidelines) DELETE endpoints don't receive objects. But I think we should allow it to give more freedom to developers. Should be fixed soon.

stojsavljevic commented 6 years ago

After some googling I found that request body for DELETE is not recommended but not forbidden as well. Here is one of the resources: https://stackoverflow.com/questions/14323716/restful-alternatives-to-delete-request-body