Adding elements to your assembly

Create your API assembly by using the Assemble view in the API Designer. You can access the Assemble view by clicking the Gateway tab in the API editor.

About this task

Note:
  • This task relates to configuring an OpenAPI 3.0 API definition. For details on how to configure an OpenAPI 2.0 API definition, see Editing an OpenAPI 2.0 API definition.
  • OpenAPI 3.0 APIs are supported only with the DataPower® API Gateway, not with the DataPower Gateway (v5 compatible).
  • For details of current OpenAPI 3.0 support limitations, see OpenAPI 3.0 support in IBM® API Connect.

You can complete this task either by using the API Designer UI application, or by using the browser-based API Manager UI.

You can use the assembly tool in the UI to create assemblies that are used to manipulate requests made to or responses made by any of your API's operations.

At any time, you can switch directly to the underlying OpenAPI YAML source by clicking the Source icon OpenAPI Source icon. To return to the design form, click the Form icon Form icon.

If you want to use the Source view to edit the source of your API definition, see execute OpenAPI extension for more information about how to configure the OpenAPI YAML.

For more information about the use of the assembly tool, see The assembly editor.

Procedure

To add elements to your assembly using the assembly tool, complete the following steps:

  1. In the navigation pane, click Develop icon in the navigation pane Develop, then select the APIs tab.
    The Develop page opens.
  2. Click the title of the API definition that you want to work with.
  3. Use the Policies view to add an element.
    Note: You must specify a version for the policy. To prevent errors due to incompatible versions of a policy between the API and the gateway, API Connect will only publish an API to the gateway if the policy version in the API exactly matches the version that is present on the gateway.
    1. Select the Gateway tab, then click Policies in the navigation pane.
    2. Click the plus icon Plus sign inside a circle at the appropriate location on the canvas to view the palette that lists the available elements.
    3. Select the element that you want to add from the palette to the canvas by clicking it.
      Note:
      • Elements are applied in order from the initial, unfilled, circle to the final, filled, circle.
      • Unless an Operation Switch element is used, the whole assembly applies to every operation in the API.
    4. Add and edit properties of the element by clicking the element and using the property sheet.
      For some elements, you can add and remove properties by clicking Object Properties and selecting the property from the drop-down list. For information about the properties of policy elements, see API policies and logic constructs. For information about the properties of logic constructs, see Logic Constructs.
    5. Specify a version for the policy.
      To add a version, click the Source icon OpenAPI Source icon, and complete the version section of the policy YAML. For example:
      execute:
        - invoke:
            version: 2.2.0
            title: invoke
      ...
      You must specify a version for the policy that is compatible with the gateway that you are using. When the API is published, if the version is incompatible with the gateway, a validation error is thrown that specifies the available versions. For more information about how to configure the policy OpenAPI YAML, see execute OpenAPI extension.
  4. Optional: Repeat Steps 3.b to 3.e for any additional elements that you want to add.
  5. Click Save to save your changes.

Results

You have added one or more elements to your assembly.