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 app driven orchestration 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. Hover your cursor over the row of the activated integration to display additional options.
  7. Click Run icon to show a message with details about running, testing, and tracking the integration.
  8. Click the Metadata URL value.

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

  9. Click Open API to display the description for this endpoint, including the server to invoke, the exposed resources, and security details.
  10. To invoke the integration, import the document into a client such as postman.
  11. 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 orchestration 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.
    The map shows 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.
    The map shows the response Parameter List > Parameter > Name element for both the source and target includes the HTML form data.

  12. Configure the business identifier to track the integration during runtime.
  13. Save and activate the integration.
    Compete integration shows a REST Adapter, mapper, REST Adapter, mapper, and return icon.

  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 orchestration 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.
    The map shows the data sent from the trigger connection to the outbound request in the invoke connection. Contact Disposition is set to a concrete value of "form-data". 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.
    The same mappings are performed for the response as were done for the request mapping.

  12. Configure the business identifier to track the integration during runtime.
  13. Save and activate the integration.
    Compete integration shows a REST Adapter, mapper, REST Adapter, mapper, and return icon.

  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 orchestration 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.
    The map shows data sent from 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.
    The mapper shows the response map. The Formdata Json Post Request Multipart Form Data Data target node represents the payload.

  12. Configure the business identifier to track the integration during runtime.
  13. Save and activate the integration.
    Compete integration shows a REST Adapter, mapper, REST Adapter, mapper, and return icon.

  14. Invoke the integration and view the results.