OpenAPI (Swagger 2.0) and assembly components

An assembly in API Connect is formed of one or more components that are applied to calls to an API. These components can be part of the OpenAPI (Swagger 2.0) specification or extensions to the specification that are specific to API Connect.

The full OpenAPI (Swagger 2.0) specification can be found at the OpenAPI (Swagger 2.0) website.

For Draft APIs with an OpenAPI (Swagger 2.0) definition file, the developer toolkit UI performs validation on it. Any warnings or errors that are highlighted will not prevent further editing of the API, or prevent it from being saved. Further validation occurs when the API is staged, as part of a Product, to a Catalog. For more information, see Staging a Product.

API Connect policies and logic constructs

To provide additional functions, API Connect uses various extensions to the OpenAPI (Swagger 2.0) specification. The following table shows the policy and logic construct extensions that can be added, and provides links to more detailed information.

The OpenAPI (Swagger 2.0) information column provides links to topics detailing the OpenAPI (Swagger 2.0) implementation of different components.

The Built-in policy and logic construct information column provides links to the topics that detail the purpose of the different policies and logic constructs, and explain how you can configure them by using the API Designer assembly editor.

Important: If you are using IBM® API Connect for IBM Cloud, you must apply only policies that can be run on the DataPower® Gateway.
Table 1. IBM OpenAPI (Swagger 2.0) extensions
Component Description OpenAPI (Swagger 2.0) information Built-in policy and logic construct information
DataPower Gateway onlyactivity-log Log the activity that passes through this component in the assembly. activity-log Activity Log (activity-log)
DataPower Gateway onlygatewayscript Include a GatewayScript program. gatewayscript GatewayScript (gatewayscript)
if Perform a part of the assembly only when a condition is fulfilled. if if
invoke Call a service. invoke Invoke (invoke)
Micro Gateway onlyjavascript Include a JavaScript program. javascript JavaScript (javascript)
DataPower Gateway onlyjson-to-xml Convert payload from JSON to XML. json-to-xml JSON to XML (json-to-xml)
DataPower Gateway onlymap Map and transform variables. map Map (map)
operation-switch Perform different actions depending on which operation has been called. operation-switch operation-switch
DataPower Gateway onlyproxy Proxy a service. proxy Proxy (proxy)
DataPower Gateway onlyredact Redact a field from transmitted data. redact Redaction (redact)
set-variable Set the value of a variable. set-variable Set Variable (set-variable)
throw Throw a specified error. throw throw
DataPower Gateway onlyvalidate Perform REST validation. validate Validate (validate)
DataPower Gateway onlyxml-to-json Convert payload from XML to JSON. xml-to-json XML to JSON (xml-to-json)
DataPower Gateway onlyxslt Apply an XSLT transform to the payload. xslt XSLT (xslt)