Adding responses to the OpenAPI descriptor
Use the context menu to add response objects to the OpenAPI descriptor.
Procedure
- Right-click in the OpenAPI Editor and click New > Response Object.
-
In the tree, select the level where you want to create the response.
The wizard shows a tree for all existing paths, methods, and operationIDs within the OpenAPI descriptor that you edit. The Path column contains the following values:
- The root or basepath. This path is the only path that never has children and it is the first entry in the tree.
- Additional path entries within the OpenAPI descriptor are listed after the root or basepath entry.
- To create the response globally, select the basePath in the table. If no basePath is defined in the OpenAPI descriptor, select root.
- To create the response for a specified operation, expand the path to where the operation is defined and select the operation.
- Specify a name for the response. The name must be a valid HTTP code or the value default.
-
Specify a description for the response.
Descriptions are required for responses.
- Optional: If any definitions exist in the swagger, a list with all existing definitions is available for you to add a schema with a reference to a definition.