OpenAPIConnector
Use OpenAPIConnector as an interface between deepset and OpenAPI services.
Basic Information
- Type:
haystack_integrations.connectors.openapi.OpenAPIConnector - Components it can connect with:
Inputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| operation_id | str | The operation ID to invoke. You can find the operation ID in the OpenAPI specification. | |
| arguments | Optional[Dict[str, Any]] | None | Optional parameters for the endpoint (query, path, or body parameters). |
Outputs
| Parameter | Type | Default | Description |
|---|---|---|---|
| response | Dict[str, Any] | Dictionary containing the service response. |
Overview
Use OpenAPIConnector to invoke REST endpoints defined in an OpenAPI specification. The OpenAPIConnector serves as a bridge between deepset pipelines and any REST API that follows the OpenAPI(formerly Swagger) specification. It dynamically interprets the API specification and provides an interface for executing API operations. It is usually invoked when it receives input arguments from a deepset pipeline run() method or by other components in a pipeline that pass input arguments to this component.
Usage Example
components:
OpenAPIConnector:
type: components.connectors.openapi.OpenAPIConnector
init_parameters:
Parameters
Init Parameters
These are the parameters you can configure in Pipeline Builder:
| Parameter | Type | Default | Description |
|---|---|---|---|
| openapi_spec | str | URL, file path, or raw string of the OpenAPI specification. | |
| credentials | Optional[Secret] | None | Optional API key or credentials for the service wrapped in a Secret |
| service_kwargs | Optional[Dict[str, Any]] | None | Additional keyword arguments passed to OpenAPIClient.from_spec(). For example, you can pass a custom config_factory or other configuration options. |
Run Method Parameters
These are the parameters you can configure for the component's run() method. This means you can pass these parameters at query time through the API, in Playground, or when running a job. For details, see Modify Pipeline Parameters at Query Time.
| Parameter | Type | Default | Description |
|---|---|---|---|
| operation_id | str | The operation ID from the OpenAPI specification to invoke. | |
| arguments | Optional[Dict[str, Any]] | None | Optional parameters for the endpoint (query, path, or body parameters). |
Was this page helpful?