I started studied web service recently with Spring and I would like to know how to parse String into JSON. My web service allow the Motus game so a player have to find a word and has 5 attempts to do it.
I would like to post the word chose by the users into the request body of the HTTP request.
@PostMapping(value = "/jouer")
public void plays(@RequestBody String name){
users.plays(name);
}
The JSON in the body would be like this:
{
"name": "elephant"
}
I wouldn't like to create classes to map the JSON.