Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Configure OpenAPI

  • Last UpdatedJun 21, 2024
  • 5 minute read

AVEVA Work Tasks allows you to configure OpenAPI, and it is complaint with Swagger 2.0 and Swagger 3.0.

To configure the OpenAPI,

  1. Right-click the Web API Activity, and then click Activity Properties option. In the Activity Properties window, click Configure Web API.

    The Web API Activity Configuration window opens.

  2. In the Web API drop-down list, select the Web API list item, which is an OpenAPI.

    This loads the OpenAPI data, which gets stored when OpenAPI list item is created using OpenAPI.

    In the Operation Group dropdown list, select the operation group provided in the JSON file of the selected OpenAPI. These groups are the tags or the logical groupings of the selected OpenAPI.

    Tags are used as Operation Group. Though Tag is an optional element in the OpenAPI Specification, if available, it will be considered as Operation Group item.

    If Tags is empty/not available, then it will not list out in Operation Group, but the operation will be directly listed under All (by default) Operation Group.

  3. In the Operation drop-down list, select the operation ID of the OpenAPI defined for the selected Operation Group in the JSON file of the selected OpenAPI.

    The OperationId is considered as Operation and will be listed out in the drop-down.

    The OperationId is an optional, unique element as per the OpenAPI Specifications. But if any of the OperationId is duplicate, then the same will be logged in the Logger.

    If the OperationId is not present, then Path_HttpMethod will be displayed as Operation under the Operation dropdown.

    Based on the Operation Group selection, the Operation will be listed in the Operation dropdown.

    If there are no Tags available for some operations, then they will appear in All Operation Group along with all other operations.

    When the Operation is selected, the HTTP methods (GET, PUT, POST, DELETE, or PATCH) and the associated parameters are retrieved from the JSON file of the selected OpenAPI.

    Note: If Operation ID is not available, the Operations Group tag is considered.

  4. In the HTTP Method, the HTTP method is displayed when you select Operation, and this is a disabled field.

  5. In the Parameters and Body tabs, enter the details given in the respective tables in this topic.

  6. In the Output settings, configure the Save output type and Save output in.

    To save the output in a Variable, select the variable that you created in the Start activity. To save the output in an XML Variable, select the XML variable that you created in the Start activity. You can also create the XML variable using the Create New option from the Save output in dropdown.

    You can overwrite the XML Variable using the Update XML Variable option after modifying the OpenAPI configuration.

    Note: If OpenAPI specification JSON file does not have a response for the selected Operation, then it will prompt the user as "The selected operation does not return any value."

  7. Click Save.

    The OpenAPI gets configured.

Parameters Tab

This tab is displayed if the selected Operation has parameters.

In the Parameter's grid, the following parameters are listed:

  • Path parameters: the parameters' value is part of the operation’s URL

  • Query parameters: the parameters that are appended to the URL

    Note: Header and Cookie parameters are not supported.

The table describes the fields available under Parameters tab.

Fields

Description

No

It displays the serial number of the parameter and represents its sequence.

Optional

It displays YES or NO values.

YES, denotes that you can either enter the value for the parameter in the Value field or leave it blank.

NO, denotes that you must enter the value for the parameter in the Value field.

Note: For the path parameter, the Optional field is always NO, but for query parameter it can be either YES or NO.

Name

It displays the name of the parameter.

Data type

It displays the data type of the parameter. The supported data types are boolean, decimal, numeric, and string.

Note: The OpenAPI-specific datatype formats are not validated.

Value

Enter the value to be passed for the parameter.

The value is validated against the data type.

The value can be hard-coded or can be passed through the Expression Editor.

Note: The value passed using Expression Editor is not validated for the data type.

Body Tab

This tab is displayed if the selected Operation is POST, PUT, or PATCH.

It is used to pass PostData to the OpenAPI, and the PostData can be passed as raw format or in the form of parameters, hence two options - Parameters and Raw are available with the Radio buttons.

Both Parameters and Raw are validated based on the selection of Content Type.

Note: In the Body tab, it is mandatory to provide data either in the Parameters or the Raw option.

Parameters:

The request body is populated in the form of the name, data type, and the value to map individual parameters with a hard-coded value or to a dynamic value that is build-up through the Expression Editor.

The table describes the fields available under Body tab for Parameters:

Fields

Description

No

It displays the serial number of the parameter and represents its sequence.

Optional

It displays YES or NO values.

YES, denotes that you can either enter the value for the parameter in the Value field or leave it blank.

NO, denotes that you must enter the value for the parameter in the Value field.

Note: For the path parameter, the Optional field is always NO, but for query parameter it can be either YES or NO.

Name

It displays the name of the parameter.

Data type

It displays the data type of the parameter. The supported data types are boolean, decimal, numeric, and string.

Note: The OpenAPI-specific datatype formats are not validated.

Value

Enter the value to be passed for the parameter.

The value is validated against the data type.

The value can be hard-coded or can be passed through the Expression Editor.

Note: The value passed using Expression Editor is not validated for the data type.

On the Body parameters, constitute the PostData, and pass it to the OpenAPI during execution.

Raw:

In this tab, you can provide raw data as PostData, either a hard-coded value or dynamic value that is built up through the Expression Editor.

The table describes the fields available under Body tab for Raw data:

Fields

Description

Post Data

Enter the value you want to pass to POST, PUT, and PATCH methods through the body.

The value should be in the format based on the content type selected in the Content Type dropdown.

Note: For more information on PATCH method, see PATCH Method.

TitleResults for “How to create a CRG?”Also Available in