Dynamic Variable in Request Body Validateion Error

Hi,

I am using a dynamic variable {{$randomInt}} in my request body and the API Designer’s schema validation on for the collection is indicating that there are validation errors.

I am using the following request body in my collections request:

{
	"email": "{{email_prefix}}shipper{{$randomInt}}{{$randomInt}}{{$randomInt}}-postmantest{{email_suffix}}",
	"password": "{{PASSWORD}}",
	"firstName": "{{$randomFirstName}}",
	"lastName": "{{$randomLastName}}",
	"phoneNumber": "{{phonenumber}}",
	"companyNumber": {{$randomInt}},
	"companyName": "{{$randomFullName}}",
	"address": "{{$randomStreetAddress}}",
	"city": "Winnipeg",
	"state": "MB",
	"zipCode": "R3C0A5",
	"country": "ca",
	"operateInUS": false,
	"dotNumber": "{{$randomInt}}"
}

When I validate the schema for the collection’s request, I end up with the following validation changes suggested.

If I change to not have the {{$randomInt}} in my request body but hard code an integer value, I do not receive any validation errors.

{
	"email": "{{email_prefix}}shipper{{$randomInt}}{{$randomInt}}{{$randomInt}}-postmantest{{email_suffix}}",
	"password": "{{PASSWORD}}",
	"firstName": "{{$randomFirstName}}",
	"lastName": "{{$randomLastName}}",
	"phoneNumber": "{{phonenumber}}",
	"companyNumber": 2,
	"companyName": "{{$randomFullName}}",
	"address": "{{$randomStreetAddress}}",
	"city": "Winnipeg",
	"state": "MB",
	"zipCode": "R3C0A5",
	"country": "ca",
	"operateInUS": false,
	"dotNumber": "{{$randomInt}}"
}

1 Like