I want to define a large json
response body as @RequestBody
parameter. Additionally I'd like to directly get some of the body parameters as
@RestController
public class MyController {
@PostMapping("/")
public Rsp test(@RequestBody JsonDTO json) {
}
}
public class JsonDTO {
private String json; //should contain the complete json object
//additionally want to map some specific properties explicit
private String test;
}
I want to send the following json content:
{
"somecontent": "asd",
...
"test": "imtest"
}
Then I need both the complete json string, and a DTO that maps only some of the parameters.
Is that possible?