# OpenApiTargetConfiguration

Configuration for OpenAPI-based MCP targets.

This configuration exposes an OpenAPI/REST API as MCP tools,
allowing the gateway to transform API operations into tool calls.

Extends: [McpTargetConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.McpTargetConfiguration.html) › OpenApiTargetConfiguration
Implements: [ITargetConfiguration](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ITargetConfiguration.html)
Obtainable from: OpenApiTargetConfiguration.create

- Source: [`lib/gateway/targets/target-configuration.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/targets/target-configuration.ts#L176)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';

declare const apiSchema: bedrock_agentcore_alpha.ApiSchema;
const openApiTargetConfiguration = new bedrock_agentcore_alpha.OpenApiTargetConfiguration(apiSchema, /* all optional props */ false);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha

# api_schema: bedrock_agentcore_alpha.ApiSchema

open_api_target_configuration = bedrock_agentcore_alpha.OpenApiTargetConfiguration(api_schema, False)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;

ApiSchema apiSchema;

OpenApiTargetConfiguration openApiTargetConfiguration = new OpenApiTargetConfiguration(apiSchema, false);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;

ApiSchema apiSchema;

var openApiTargetConfiguration = new OpenApiTargetConfiguration(apiSchema, false);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"

var apiSchema ApiSchema

openApiTargetConfiguration := bedrock_agentcore_alpha.NewOpenApiTargetConfiguration(apiSchema, jsii.Boolean(false))
```

## Initializer

TypeScript:

```ts
new OpenApiTargetConfiguration(apiSchema: ApiSchema, validateSchema?: boolean)
```

Python:

```python
OpenApiTargetConfiguration(api_schema: ApiSchema, validate_schema: typing.Optional[bool] = None)
```

Java:

```java
new OpenApiTargetConfiguration(ApiSchema apiSchema, Boolean validateSchema)
```

C# / .NET:

```csharp
new OpenApiTargetConfiguration(ApiSchema apiSchema, bool? validateSchema = null)
```

Golang:

```go
NewOpenApiTargetConfiguration(ApiSchema ApiSchema, ValidateSchema *bool)
```

## Properties

- `apiSchema`: [ApiSchema](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ApiSchema.html) — The OpenAPI schema that defines the API.

- `targetType`: [McpTargetType](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.McpTargetType.html) — The target type.

## Methods

- `bind(scope: Construct, gateway: IGateway): TargetConfigurationConfig` — Binds this configuration to a construct scope Sets up necessary permissions for the gateway to access the API schema.

  **Parameters**

  - `scope` — The construct scope.
  - `gateway` — The gateway that will use this target.

- `create(apiSchema: ApiSchema, validateSchema?: boolean): OpenApiTargetConfiguration // chainable` (static) — Create an OpenAPI target configuration.

  **Parameters**

  - `apiSchema` — The OpenAPI schema.
  - `validateSchema` — Whether to validate the OpenAPI schema (only applies to inline schemas).

  **Returns:** A new OpenApiTargetConfiguration instance
