Steer JSON DataTypes in requests
When working with JSON payloads in requests, you can use other DataTypes than those recorded with the Tosca API Scan.
The DataTypes used in Tosca Commander define how values are translated in the JSON payload. For further information on DefaultDataTypes, please refer to chapter "DefaultDataType".
When changing DataTypes for JSON Module Attributes in request TestSteps, refer to the following table:
|
JSON Value |
JSON DataType |
Value in Commander |
DataType in Commander |
|---|---|---|---|
|
"Value" |
String |
Value |
String |
|
123 |
Integer |
123 |
Numeric |
|
"123" |
String |
123 |
String |
|
1.23 |
Float |
1.23 |
Numeric |
|
True |
Boolean |
True |
Boolean |
|
"True" |
String |
True |
String |
|
null |
Null |
null |
any DataType can be used |
|
"null" |
String |
"null" |
String |
|
"" |
String |
{NULL} |
String |
|
"" |
String |
|
String |
|
The following example shows how JSON values in Tosca Commander are translated into JSON payloads in requests.
JSON values in Tosca Commander
JSON values translated into a JSON payload |