put:
  requestBody:
    required: true
    content:
      application/json:
        schema:
          $ref: '../../schemas/widget.yaml'
  responses:
    200:
      description: Update Succesful
      content:
        application/json:
          schema:
            $ref: '../../schemas/widget.yaml'
    406:
      description: Malformed Request
      content:
        application/json:
          schema:
            $ref: '../../schemas/error.yaml'
    500:
      description: Internal Service Error
      content:
        application/json:
          schema:
            $ref: '../../schemas/error.yaml'
  x-amazon-apigateway-integration:
    passthroughBehavior: "never"
    requestTemplates:
      "application/json": |
          #set($inputRoot = $input.path('$'))
          {
            "widgetName" : "$inputRoot.widgetName",
            "color" : "$inputRoot.color"
          }
    responses:
      default:
        statusCode: "200"
        responseTemplates:
          "application/json" : |
                 #set($inputRoot = $input.path('$'))
                 {
                   "widgetName": "$inputRoot.widgetName",
                   "color": "$inputRoot.color"
                 }
      NotAcceptable.*:
        $ref: "../../gatewayResponses/notFound.yaml"
      .*error.*:
        $ref: "../../gatewayResponses/error.yaml"
    uri:
      Fn::Sub: arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${widgetPutLambda.Arn}/invocations
    httpMethod: POST
    type: "aws"
  x-amazon-apigateway-request-validator: "all"