# ModelProps

Extends: ModelProps
Extends: ModelOptions
Used as props by: Model

- Source: [`aws-apigateway/lib/model.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-apigateway/lib/model.ts#L103)

## Example

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

declare const default_: any;
declare const enum_: any;
declare const jsonSchema_: apigateway.JsonSchema;
declare const restApi: apigateway.RestApi;
const modelProps: apigateway.ModelProps = {
  restApi: restApi,
  schema: {
    additionalItems: false,
    additionalProperties: false,
    allOf: [jsonSchema_],
    anyOf: [jsonSchema_],
    contains: jsonSchema_,
    default: default_,
    definitions: {
      definitionsKey: jsonSchema_,
    },
    dependencies: {
      dependenciesKey: ['dependencies'],
    },
    description: 'description',
    enum: [enum_],
    exclusiveMaximum: false,
    exclusiveMinimum: false,
    format: 'format',
    id: 'id',
    items: jsonSchema_,
    maximum: 123,
    maxItems: 123,
    maxLength: 123,
    maxProperties: 123,
    minimum: 123,
    minItems: 123,
    minLength: 123,
    minProperties: 123,
    multipleOf: 123,
    not: jsonSchema_,
    oneOf: [jsonSchema_],
    pattern: 'pattern',
    patternProperties: {
      patternPropertiesKey: jsonSchema_,
    },
    properties: {
      propertiesKey: jsonSchema_,
    },
    propertyNames: jsonSchema_,
    ref: 'ref',
    required: ['required'],
    schema: apigateway.JsonSchemaVersion.DRAFT4,
    title: 'title',
    type: apigateway.JsonSchemaType.NULL,
    uniqueItems: false,
  },

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

## Properties

- `contentType`: string = 'application/json' — The content type for the model.

  You can also force a
  content type in the request or response model mapping.

- `description`: string = None — A description that identifies this model.

- `modelName`: string — A name for the model.

  **Default:** <auto> If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the model name. For more information, see Name Type.

  Important
   If you specify a name, you cannot perform updates that
   require replacement of this resource. You can perform
   updates that require no or some interruption. If you
   must replace the resource, specify a new name.

- `restApi`: [IRestApi](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IRestApi.html) (required) — The rest API that this model is part of.

  The reason we need the RestApi object itself and not just the ID is because the model
  is being tracked by the top-level RestApi object for the purpose of calculating its
  hash to determine the ID of the deployment. This allows us to automatically update
  the deployment when the model of the REST API changes.

- `schema`: [JsonSchema](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.JsonSchema.html) (required) — The schema to use to transform data to one or more output formats.

  Specify null ({}) if you don't want to specify a schema.
