title: AWS Lambda and Dynamo: One or more parameter values were invalid
body: <p>I just started using AWS and I'm trying to get a Lambda up and running with the API Gateway posting/getting from DynamoDB. I'm using the inline code editor with dynamodb-doc. I am continually getting the error:</p>
  
  <pre><code>One or more parameter values were invalid: Condition parameter type does not match schema type
  </code></pre>
  
  <p>I'm not sure why this is. My table is set in in Dynamo with the partition key being BusinessAsset_ID and the GSI BusinessAsset_ID-index. What's weird is that my POST actually works and successfully puts items into Dynamo. My code is below. Thanks in advance!</p>
  
  <p>EDIT: I am using an API Gateway GET method with the "Lambda Function" integration type and the "Use Lambda Proxy integration" box checked. I have also tried using the method as an "AWS Service" with the path override and execution role. It resulted in the same 502 Bad Gateway error with the same error message above.</p>
  
  <pre><code>'use strict';
  
  const doc = require('dynamodb-doc');
  
  const dynamo = new doc.DynamoDB();
  
  exports.handler = function(event, context) {
    switch (event.httpMethod) {
        case 'GET':
            var params = {
                TableName: event.queryStringParameters.TableName,
                KeyConditionExpression: "BusinessAsset_ID = :assetId",
                ExpressionAttributeValues: { 
                    ":assetId": parseInt(event.queryStringParameters.AssetId)
                }
            };
  
            console.log("params: " + JSON.stringify(params));
  
            dynamo.query(params, context.done );
            break;
        case 'POST':
            dynamo.putItem(JSON.parse(event.body), context.done);
            break;
        default:
            context.done(new Error(`Unsupported method "${event.httpMethod}"`));
    }
  };
  </code></pre>