Adding operations to the OpenAPI descriptor

Use the context menu to add operation objects to the OpenAPI descriptor.

Procedure

  1. Right-click in the OpenAPI Editor and click New > Operation Object.
    • If no path exists in the swagger, nothing happens. Operations can only be added to paths.
    • If at least one path exists, a wizard opens. The wizard shows a tree for all existing paths and operations.
  2. Select a path.
    The operation is created for the selected path.

    Path parameters are required for each operation that is defined on a path. To reduce errors, TPF Toolkit generates the required path parameters automatically. However, the type element for the required path parameter is not included because the type of the path parameter cannot be derived during path creation. A warning is displayed in the file as a reminder to add the element. To add this element, manually add a line within the OpenAPI descriptor where the warning denotes and add the type element. Valid types are: boolean, string, number or integer. For example, "type":"boolean".

  3. Select a method in the Method list.
    Duplicate method names cannot exist under the selected path. If you enter a duplicate method name, an error is displayed on Finish and the wizard remains active until the problem is resolved. For example, if you want to create a GET method for a path that already has the GET method, you need to cancel, choose a different path, or choose a different method.
  4. Specify a valid operationID.
    • The operationID cannot be longer than the length that TPF supports.
    • The operationID must be unique. If the operationID already exists in the OpenAPI descriptor, an error is displayed on Finish and the wizard remains active until the problem is resolved.