Common errors encountered when updating an OpenAPI document in z/OS Connect Designer
How to fix common errors that are encountered when an OpenAPI document is updated in z/OS Connect Designer.
Some of the API project paths, operations, and mappings might break as a result of updating the OpenAPI document. The following are common errors that might occur when updating an OpenAPI document, and how to fix them.
- OpenAPI document path deletion
- If you deleted a path from the OpenAPI document,
- Go to the src/main/operations folder within your API project.
- Delete the folder corresponding to that path.
This is not mandatory but it avoids having folders in the API project that are no longer needed.
For example, if you delete the path /employees/{id}, the folder to delete would be %2Femployees%2F%7Bid%7D.
- OpenAPI document operation deletion
- If you deleted an operation from a particular path in the OpenAPI document,
- Go to the src/main/operations folder within your API project.
- Go to the folder for the path whose operation is removed.
- Delete the folder corresponding to the operation.
This is not mandatory but it avoids having folders in the API project that are no longer needed.
For example, if thePUT
operation is deleted in the /employees/{id} path,- Go to src/main/operations (path) folder.
- Go to %2Femployees%2F%7Bid%7D (path) folder.
- Delete the
put
(operation) folder.
- OpenAPI document response code deletion
- If you deleted a response code from a particular operation of any path in the OpenAPI document,
- Go to the src/main/operations folder within your API project.
- Go to the folder for the respective path of the response code.
- Go to the folder for the respective operation.
- Delete the response_xxx.yaml file that corresponds to the response code deleted from the operation.
For example, if you deleted the response code404
in thePUT
operation under the /employees/{id} path,- Go to the src/main/operations folder.
- Go to the path folder, %2Femployees%2F%7Bid%7D
- Go to the operation folder, put.
- Delete the file response_404.yaml.
Also in the z/OS Connect Designer, go to the corresponding operation’s page, click Responses, and ensure that the response conditions for the operation are valid. If needed, update the conditions.
If you have not made any changes here, ensure that there are no references to the deleted response code in the API project. To do this,- Go to the src/main/operations folder within your API project.
- Go to the folder for the respective path.
- Go to the folder for the respective operation.
- Open the response_mapping.yaml file. Check whether there are any conditions set for the deleted response code. If yes, delete the block for that response code from this file and save.
- OpenAPI document - request body or request parameter deletion
-
If you deleted a field from the request body or request parameters for a particular operation, of any path in the OpenAPI document, use these steps.
- Go to the corresponding operations page in z/OS Connect Designer by using the left navigation.
- Click the button that is named after the z/OS Asset used by the operation.
- In the mapping editor, ensure that none of the fields that are deleted from either the request body or request parameters are used. If used, update the input field to use something from the available mappings. Close the panel.
- Click Responses. In the condition editor, ensure that none of the deleted fields are used. Close the panel.
- In the mapping editor, click each response code button and ensure that none of the deleted fields are used.
- OpenAPI document - response body or response parameter deletion
- If you deleted a field from the response body or response headers for a response code, of a
particular operation, of any path in the OpenAPI document.
- Go to the src/main/operations folder within your API project.
- Go to the folder for the respective path.
- Go to the folder for the respective operation. For example,
put
. - Open the response_xxx.yaml file that corresponds to the response code under
which you deleted a field. In the
yaml
file, delete the mappings that use the deleted field.