# CfnModelProps

Struct · External

Properties for defining a `CfnModel`.

Used as props by: [CfnModel](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.CfnModel.html)

- Source: Generated at build time
- Type last changed: v2.227.0 · 21 Nov 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigatewayv2 as apigatewayv2 } from 'aws-cdk-lib';

declare const schema: any;
const cfnModelProps: apigatewayv2.CfnModelProps = {
  apiId: 'apiId',
  name: 'name',
  schema: schema,

  // the properties below are optional
  contentType: 'contentType',
  description: 'description',
};
```

Python:

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

# schema: Any

cfn_model_props = apigatewayv2.CfnModelProps(
    api_id="apiId",
    name="name",
    schema=schema,

    # the properties below are optional
    content_type="contentType",
    description="description"
)
```

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.apigatewayv2.*;

Object schema;

CfnModelProps cfnModelProps = CfnModelProps.builder()
        .apiId("apiId")
        .name("name")
        .schema(schema)

        // the properties below are optional
        .contentType("contentType")
        .description("description")
        .build();
```

C#:

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

var schema;

var cfnModelProps = new CfnModelProps {
    ApiId = "apiId",
    Name = "name",
    Schema = schema,

    // the properties below are optional
    ContentType = "contentType",
    Description = "description"
};
```

Go:

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

var schema interface{}

cfnModelProps := &CfnModelProps{
	ApiId: jsii.String("apiId"),
	Name: jsii.String("name"),
	Schema: schema,

	// the properties below are optional
	ContentType: jsii.String("contentType"),
	Description: jsii.String("description"),
}
```

## Properties

- `apiId`: string | [IApiRef](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.interfaces.aws_apigatewayv2.IApiRef.html) (required) — The API identifier.

- `contentType`: string — The content-type for the model, for example, "application/json".

- `description`: string — The description of the model.

- `name`: string (required) — The name of the model.

- `schema`: any (required) — The schema for the model.

  For application/json models, this should be JSON schema draft 4 model.
