Amazon API Gateway REST API Reference

Model

Represents the data structure of a method's request or response payload.


Relation Description Method Templated
self

A relation that refers to the current resource.

GET No
model:create

Creates a new model for an API.

POST No
model:update

Updates properties of a Model resource.

PATCH No
model:delete

Deletes a model.

DELETE No
model:generate-template

Generates a sample mapping template that can be used to transform a payload into the structure of a model.

GET No


Properties

{
  "id" : "String",
  "name" : "String",
  "description" : "String",
  "schema" : "String",
  "contentType" : "String"
}

  • id
  • The identifier for the model resource.

  • name
  • The name of the model.

  • description
  • The description of the model.

  • schema
  • The schema for the model. For application/json models, this should be JSON-schema draft v4 model. Do not include "*/" characters in the description of any properties because such "*/" characters may be interpreted as the closing marker for comments in some languages, such as Java or JavaScript, causing the installation of your API's SDK generated by API Gateway to fail.

  • contentType
  • The content-type for the model.

Remarks

A request model defines the data structure of the client-supplied request payload. A response model defines the data structure of the response payload returned by the back end. Although not required, models are useful for mapping payloads between the front end and back end.

A model is used for generating an API's SDK, validating the input request body, and creating a skeletal mapping template.

See Also

Method, MethodResponse, Models and Mappings