How to specify variable type while starting a process

How to specify variable type while starting a process via REST? For example if I do this, the variable is still “text” type:

{
   "processDefinitionKey":"oneTaskProcess",
   "businessKey":"myBusinessKey",
   "returnVariables":false,
   "tenantId": "tenant1",
   "variables": [
      {
        "name":"total",
        "type":"double",
        "value":1234.56,
      }
   ]
}

Hi.

Is this the exact json payload?
This isn’t valid; “value”:1234.56,

Regards,

Yvo

This is the real part. How is it not valid?

name:"yujihejia",
type:"double",
value:54810810.76

Your first json payload was formatted wrong. (The last comma)

When I do a start process instance request like this;

{
   "processDefinitionKey": "testvar1",
   "variables": [
      {
        "name": "myVar",
        "value": 15.32,
        "type": "double"
      }
   ]
}

The process instance get started with a double variable on the context.

Regards,

Yvo

Thank you. You are right. It’s my code mistake.