The OpenAPI connector, known by the type name openapi, exposes OpenAPI data sources via relational concepts and uses the CData Virtuality WS resource adapter for making web service calls.

OpenAPI is a simple yet powerful representation of your RESTful API. With the largest ecosystem of API tooling on the planet, thousands of developers are supporting OpenAPI in almost every modern programming language and deployment environment. With an OpenAPI-enabled API, you get interactive documentation, client SDK generation, and discoverability.

This translator is compatible with OpenAPI/Swagger v2 and OpenAPI v3.

OpenAPI v3 is available since v4.0.7

Usage

Usage of a OpenAPI source is similar to any other connector in CData Virtuality. The connector enables metadata import. The metadata is imported from the source system’s metadata file and then exposed as stored procedures in CData Virtuality. The source system can be queried by executing these stored procedures in the CData Virtuality system.

Although parameter order is guaranteed by the Swagger libraries, if you rely upon the native import, it is best if you call procedures using named, rather than positional parameters.

Here is how to configure a connection using the SYSADMIN.createConnection() and SYSADMIN.createDataSource() procedures:

/* Create connection */
CALL SYSADMIN.createConnection(name => 'scm', jbossCliTemplateName => 'ws', connectionOrResourceAdapterProperties => 'EndPoint=https://docs.oracle.com/en/cloud/saas/supply-chain-management/r13-update17d/fasrp,decompressCompressedFiles=false,SecurityType=None', encryptedProperties => '');;
/* Create data source */
CALL SYSADMIN.createDatasource(name => 'scm', translator => 'openapi', modelProperties => '', translatorProperties => '', encryptedModelProperties => '', encryptedTranslatorProperties => '');;
CALL "scm.inventoryOrganizations/OrganizationId/child/invOrgParameters"(
"OrganizationId" => 'foo'
);;

Execution Properties

Execution properties extend/limit the functionality of the connector based on the physical source capabilities. Sometimes default properties must be adjusted for the proper execution of the translator.

Execution Properties

None.

Importer Properties

The following table lists the importer properties that define the behaviour of the connector during the import from the physical source.

Property

Description

Default

metadataUrl

URL from which to obtain the OpenAPI metadata. May be a local file using a file: URL

TRUE

server

Server to use. If not specified, the first server listed will be used

null

preferredProduces

Preferred Accept MIME type header; should be one of the OpenAPI 'produces' types

application/json

preferredConsumes

Preferred Content-Type MIME type header; should be one of the OpenAPI 'consumer' types

application/json

JCA Resource Adapter

The resource adapter for this translator is a Web Service Data Source.

Native queries - The OpenAPI connector cannot perform native or direct query execution. However, you can use the InvokeHTTP method of the Web services translator to issue REST-based calls, and then use SQLXML to parse results.

Limitations

The OpenAPI connector does not fully implement all of the features of OpenAPI. The following limitations apply:

  • You cannot set the MIME type to application/xml in either the Accept or Content-Type headers;

  • File and Map properties cannot be used. As a result, any multi-part payloads are not supported;

  • The connector does not process security metadata;

  • The connector does not process custom properties that start with x-;

  • The connector does not work with the following JSON schema keywords:

    • allOf

    • multipleOf

    • items