Mapping REST resource verb parameters

After you specify mapping between the REST interface-annotated ABL routine and the defined REST resource verb, you need to create mapping rules that associate the interface parameters (input and output parameters of an ABL routine) with the response or request parameters (input and output parameters in the REST resource). The REST Expose Editor provides a visual mapping tool to create the mapping rules.

A REST resource verb includes two distinct parameter mapping:

When you select a REST resource verb in the Verbs Association section, the mapping definition section on the REST Expose Editor displays hierarchical representations of the REST resource parameters and the ABL routine parameters. There is a tab for each type of parameter mapping: Input and Output.

On Input tab, input parameters to operation are mapped from elements of a request component that consists of the following:

You can map each element of the request to input parameters.

On Output tab, output parameters from an operation are mapped to a HTTP (REST resource) response.

Elements of a HTTP parameters include:
  • Interface parameters
  • Advanced parameters including constants

Elements of a HTTP response include:

In the mapping definition section, the source tree is on the left and the target on the right. For input parameters, the Request is the source and the interface parameters (ABL routine parameters) is the target; for output parameters the interface parameters (ABL routine parameters) is the source and the Response is the target. To create a mapping rule, click on the parameter field and drag a line to the required operation parameter.

When creating a rule for mapping an interface parameters that contains a simple type (integer, string, or boolean) to a HTTP (REST resource) parameter that contains similar type, you can drag a line between the elements as follows:

The mapping section represents each defined rule with a blue line between elements.

Note: You can delete a defined mapping rule, by selecting the blue line defined between the elements and selecting Delete from the context menu or pressing the DELETE key. Delete All option on the context menu allows you to remove all the defined mapping rules.