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

  • The DataType Numeric with the Value 2 is translated into JSON as integer with the value 2.

  • The DataType String with the Value 2 is translated into JSON as string with the value "2".

  • The DataType Numeric with the Value 2.0 is translated into JSON as float with the value 2.0.

  • The DataType String with the Value 2.0 is translated into JSON as string with the value "2.0".

JSON values translated into a JSON payload