This is the JSON request that I need to pass to other API, My problem is I dont know how to create an object that can have other object inside.
What is the best approach for this, I'll be using ObjectMapper to convert the object into json like this.
{
"request": {
"head": {
"version": "1.0.0",
"function": "sample.function",
"clientId": "clientId",
"clientSecret": "clientSecret",
"reqTime": "2001-07-04T12:08:56+05:30",
"reqMsgId": "reqMessageID",
"reserve": ""
},
"body": {
"occurTime": "2018-03-04T12:08:56+08:00",
"bizScene": "SAMPLE_BIZ",
"envInfo": {
"tokenId": "jkahsdhsjakdhkjsajdsahdkjsakdhsa===",
"clientIp": "127.0.0.1",
"appVersion": "v0.1.0",
"terminalType": "NOP"
},
"extendInfo": {
"PSID":"87943297427",
"PSID_CreatedDate":"2018-01-04T12:08:56+08:00",
"mobtelLinkingDate" : "2018-03-04T12:08:56+08:00",
"mobtelUnlinkingDate" : "2018-04-04T12:08:56+08:00",
"activeLinkedMobtel" : "123756"
},
"accountInfo": {
"userMobile": "123756"
},
"operationInfoDTO" : {
"operationOrigin": "TWEETER",
},
"operationType": "SAMPLE",
"operationResult": "FALSE",
}
},
"signature": "signature string"
}