code for the controller
@RequestMapping(value = "/second", method = RequestMethod.POST,
consumes = "application/json")
@ResponseBody
public void test(@RequestBody RegistrationRequest
registrationRequest)
{
System.out.println(registrationRequest.toString());
}
POJO
@Data
@JsonDeserialize(using = Base64Deserializer.class)
public class RegistrationRequest {
@JsonProperty("payment-method-details")
public PaymentMethodDetails paymentMethodDetails;
@JsonProperty("customer-details")
public CustomerDetails customerDetails;
}
CustomerDetails, PaymentMethodDetails are POJO of their own. I am very new to the Spring MVC concepts, and this is all I have figured out till now but while making the post request from the Postman, it isn't working. What is wrong that I am doing?
I can not maneuver anything how the request is going to come.
Using Base64 deserialiser
Decode base64 encoded JSON to POJO with jackson and spring-boot