Create an operation to list employees
Create an operation to list employees
Before you begin
About this task
This operation is implemented as an HTTP GET request and shows you how to expose a resource for
the employeeList
service.
Procedure
- Rename the default Path value to be /employees by typing over the existing value.
-
Remove the POST, PUT and DELETE methods by clicking on the
at the end of the line. This should leave only the GET method allowed for the path /employees.
- Click Service... for the GET method to import the
employeeList.sar
file.The Select a z/OS Connect Service dialog opens. - Click Workspace or File System, depending
on where your employeeList.sar file is located, and select it to import. Click
Open. The Import Services dialog opens. Click OK. The employeeList service now appears in the Service dialog.Click OK. The operation now maps to the
employeeList
service. - From the menu bar, select .
- Click Mapping... for the GET method that uses the
employeeList
service. Click Open Default Response Mapping. The response mapping editor opens, so that you can define the mappings between the JSON content returned from the IBM® z/OS® Connect service and the response the API returns. - In the response mapping, create a Remove transform for the JSON property
StatusCode
by right-clicking on the JSON property and selecting Add Remove transform.This removes the property from the API response. - Save and close the response mapping file.