Understanding Parameter Rule Objects

The 'parameterRule' objects are described in the following table.

Object Required / Optional Description
name Required

Specifies the parameter name to match.

To override a property when you have a name conflict, specify the type of object from the API definition in front of the parameter name, separated by a slash in the format '<type_of_object>/<parameter_name>'.

For example, if you have a parameter named “name” and a nested parameter also named “name”, you must specify the type of object for the nested parameter as shown below.

  {
   name : 'name',
   value : 'Romeo',
   location : 'body',
   type : 'string',
   includeOperations : [ 'addPet']
  },
  {
   name : 'tag/name',
   value : 'Juliet',
   location : 'body',
   type : 'string',
   includeOperations : [ 'addPet']
  },

value Required

Specifies the parameter value to substitute or inject.

location Optional

Identifies the parameter location to match. Options are:

  • 'body'

  • 'header'

  • 'path'

  • 'query'

  • 'any'

The default is 'any' and matches all locations .

type Optional

Identifies the parameter type to match. Options are:

  • 'number'

  • 'boolean'

  • 'string'

  • 'file' (See filename below.)

  • 'date'

  • 'any'

The default is 'any' and matches all types.

filename Optional

Replaces the filename attribute of a matching multipart or form file entry. Valid only if type is 'file'.

inject Optional

Replaces parameter values. Options are:

  • true - injects the parameter in the specified location regardless of whether a matching name or type is found.

  • false - replaces only parameter values that match the specified name, location, and type.

The default is false.

base64Decode Optional

Specifies whether 'value' is base64 encoded binary data. Options are:

  • true - 'value' is assumed to be base64 encoded binary data and will be decoded into a byte array when inserted into a generated HTTP request.

  • false - 'value' is not base64 encoded binary data.

The default is false.

includeOperations Optional

Applies this parameter rule to the operation IDs in the list, expressed an array of operation IDs.

Example:

[ 'operation1', 'operation2', 'operationN' ]

excludeOperations Optional

Does not apply this parameter rule to the operation IDs in the list, expressed as an array of operation IDs.

Example:

[ 'operation1', 'operation2', 'operationN' ]