ggeorgovassilis / spring-rest-invoker

Spring invoker which maps remote REST services to local interfaces.
Apache License 2.0
37 stars 19 forks source link

Use MultiValueMaps for dataObjects in HttpJsonInvokerFactoryProxyBean #5

Closed ggeorgovassilis closed 10 years ago

ggeorgovassilis commented 10 years ago

@mguennec writes:

For example : @RequestMapping(value = "/folders/{folderId}/documents", method = RequestMethod.POST) Document createDocument(@PathVariable("folderId") String folderId, @RequestBody @RequestParam("properties") Document props, @RequestBody @RequestParam("data") Resource data);

It should send something like that : POST /folders/{folderId}/documents (multipart/form-data) { {(application/json) properties: {props content}}, {(application/octet-stream) data: {binarydatacontent}} }

The idea is to be able to send different types of contents (including binaries) in a form which is the behavior of FormHttpMessageConverter which can only work with a MultiValueMap and not a Map.

mguennec commented 10 years ago

RequestPart may be better suited for this kind of behavior than RequestBody. A possibility of implementation keeping the RequestBody behavior but using the RequestPart parameters over the RequestBody: https://github.com/mguennec/spring-rest-invoker/commit/6fb4be9e006120a76e971f4259f67da6d4e2d3f1

ggeorgovassilis commented 10 years ago

@mguennec would you have a look at the current trunk and see if the implementation covers this ticket?

mguennec commented 10 years ago

It looks good to me :+1: