I am trying to create some records using post method but it throws an exception as below:
JSON_PARSER_EXCEPTION "Unexpected parameter encountered during deserialization: JSON Body:
{
"DummyRequest":{
"HeaderData":{
"RecordTypeName":"abc"
},
"Cpdt":[
{
"Item":"48262"
}
],
"CasoDt":{
"CaseObj":""
}
}
}
Apex Class:
@RestResource(urlMapping='/CaseRecCreation/*')
global without sharing class APICreatRec{
global cls_DummyRequest DummyRequest;
global class cls_DummyRequest {
public cls_HeaderData HeaderData;
public cls_Cpdt[] Cpdt;
public cls_CasoDt CasoDt;
}
global class cls_HeaderData {
public String RecordTypeName;
}
global class cls_Cpdt {
public String Item;
}
global class cls_CasoDt {
public String CaseObj;
}
@HttpPost
global static void CreateOrderReq(cls_DummyRequest cObj) {
Case orc= new Case();
}
}