Defining and mapping headers, query parameters, or path parameters
You can add HTTP headers, query parameters, and path parameters to request messages and
map them to various request fields. For response messages, HTTP headers can be added and mapped to
various response fields.
If a parameter or header is an array, you must specify the data type in the array and the array
format. The data type can be string, integer, boolean or number. The array format specifies the how
the values in the parameter or header are delimited.
Mapping rules for array type parameters and headers
For array type parameters and HTTP headers, note the following rules:
Because a parameter or header inherits constraints from the service field that they are mapped
to, an array type parameter or header inherits the values for minimum items and maximum items from
the service fields.
The HTTP element and the corresponding service field must have the same array depth (that is,
they are nested within an identical number of array dimensions).
Only single-dimension arrays can be mapped to an HTTP header or parameter.
The following example shows an API that allows adding a contact entry based on a unique last
name.Figure 1. A lastName path parameter that is defined in the API editor
Based on the specified last name, the POST method would add the first name, middle name, address,
and phone numbers. As shown in the following figure, middleNames,
addressLines, and phoneNumber from the request are arrays
of strings (string[]).Figure 2. middleNames, addressLines, and
phoneNumber as string arrays
Based on the following Swagger document of the API, multiple comma-separated middle names can be
specified. The address are pipe-separated lines, and phone numbers can be multiple entries.
POST https://<serverName>/<portNumber>/<apiName>/Doe?firstName=John&
middleName=J.,R.,Edgar&
addressLines=555%20Bailey%20Ave|San%20Jose,%20CA|95123&
phoneNumber=14081111111&phoneNumber=14082222222&phonenumber=14083333333