OpenAPI Document Patterns

You can use the REST Adapter to implement the following common patterns using OpenAPI documents.

Publish REST-Based Integrations as OpenAPI Documents

You can publish an OpenAPI document describing an Oracle Integration REST endpoint and consume the OpenAPI document using the REST Adapter. This section provides an overview of the configuration steps.

  1. Create a REST Adapter connection. The connection can use any security policy.
  2. On the Integrations page, create an application integration.
  3. Add the REST Adapter created in Step 1 as the trigger connection.
  4. Design the integration.
  5. On the Integrations page, activate the integration.
  6. Click Actions icon, then Run to open the Run and configure page for running the integration.
  7. Click the Endpoint Metadata value.

    This shows a message with a link to the Endpoint URL, Swagger, and Open API descriptions of the REST endpoint.

  8. Click Open API to display the description for this endpoint, including the server to invoke, the exposed resources, and security details.
  9. To invoke the integration, import the document into a client such as postman.
  10. Select an resource to invoke, and click Send. For this example, getEmployee is selected. This matches the selection made on the Operation Selection page of the Adapter Endpoint Configuration Wizard.

Consume and Publish OpenAPI Documents with Multipart/Mixed and Multipart/Form-Data

You can consume and publish OpenAPI documents with multipart/mixed and multipart/form-data in REST Adapter trigger connections. This section describes how to configure this type of scenario in Oracle Integration.

Consume an OpenAPI Document with Endpoints that Consume or Produce HTML Form Data

  1. Create a REST Adapter connection and select the Trigger and Invoke role.
  2. In the Connection Properties section, select OpenAPI 1.0/2.0/3.0 URL and specify the connection URL.
  3. Create an application integration.
  4. Add a REST Adapter trigger connection.
  5. On the Resource Configuration page, select a POST action with Configure a request payload for this endpoint and Configure this endpoint to receive the response.
  6. On the Request page, select Request is multipart with payload and Multipart request is of type multipart/form-data with HTML form payload.
  7. On the Response page, select Request is multipart with payload and Multipart request is of type multipart/form-data with HTML form payload.
  8. Add a second REST Adapter as an invoke connection to call the OpenAPI endpoint.
  9. On the Operation Selection page, select /formdata_html from the Resource list to call the endpoint.
  10. In the request mapper between the two REST Adapter connections, map the data sent to the trigger connection to the outbound request in the invoke connection. The Parameter List > Parameter > Name element for both the source and target includes the HTML form data.
  11. In the response mapper after the second REST Adapter connection, perform the same mappings for the response from the outbound call.
  12. Configure the business identifier to track the integration during runtime.
  13. Save and activate the integration.
  14. Invoke the integration and view the results.

Consume an OpenAPI Document with Endpoints with a Multipart/mixed Content Type

  1. Create a REST Adapter connection and select the Trigger and Invoke role.
  2. In the Connection Properties section, select OpenAPI 1.0/2.0/3.0 URL and specify the connection URL.
  3. Create an application integration.
  4. Add a REST Adapter trigger connection.
  5. On the Resource Configuration page, select a POST action with Configure a request payload for this endpoint and Configure this endpoint to receive the response.
  6. On the Request page, select the following:
    1. Select Request is multipart with payload.
    2. Select JSON Sample in the dropdown and supply a valid JSON sample object.
    3. Select multipart/mixed.
  7. On the Response page, select the following:
    1. Select Request is multipart with payload.
    2. Select JSON Sample in the dropdown and supply a valid JSON sample object.
    3. Select multipart/mixed.
  8. Add a second REST Adapter as an invoke connection to call the OpenAPI endpoint.
  9. On the Operation selection page, select /mixed_json from the Resource list to call the endpoint.
  10. In the request mapper between the two REST Adapter connections, map the data sent to the trigger connection to the outbound request in the invoke connection. Contact Disposition is set to a concrete value of "form-data". It must be form data for multipart mixed to work. The Mixed Json Post Request and Multipart Mixed Data target node represents the payload.
  11. In the response mapper after the second REST Adapter connection, perform the same mappings for the response from the outbound call.
  12. Configure the business identifier to track the integration during runtime.
  13. Save and activate the integration.
  14. Invoke the integration and view the results.

Consume an OpenAPI Document with Endpoints with multipart/form-data

  1. Create a REST Adapter connection and select the Trigger and Invoke role.
  2. In the Connection Properties section, select OpenAPI 1.0/2.0/3.0 URL and specify the connection URL.
  3. Create an application integration.
  4. Add a REST Adapter trigger connection.
  5. On the Resource Configuration page, select a POST action with Configure a request payload for this endpoint and Configure this endpoint to receive the response.
  6. On the Request page, select the following:
    1. Select Request is multipart with payload.
    2. Select JSON Sample in the dropdown and supply a valid JSON sample object.
    3. Select multipart/form-data.
  7. On the Response page, select the following:
    1. Select Request is multipart with payload.
    2. Select JSON Sample in the dropdown and supply a valid JSON sample object.
    3. Select multipart/form-data.
  8. Add a second REST Adapter as an invoke connection to call the OpenAPI endpoint.
  9. On the Operation selection page, select /formdata_json from the Resource list to call the endpoint.
  10. In the request mapper between the two REST Adapter connections, map the data sent to the trigger connection to the outbound request in the invoke connection. The Formdata Json Post Request Multipart Form Data Data target node represents the payload.
  11. In the response mapper after the second REST Adapter connection, perform the same mappings for the response from the outbound call.
  12. Configure the business identifier to track the integration during runtime.
  13. Save and activate the integration.
  14. Invoke the integration and view the results.