{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-dynamodb/json-schema/amazon-dynamodb-query-input-schema.json",
  "title": "QueryInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-dynamodb-operations-api-openapi.yml#/components/schemas/QueryInput",
  "type": "object",
  "properties": {
    "TableName": {
      "type": "string",
      "description": "The name of the table containing the requested items. You can also provide the Amazon Resource Name (ARN) of the table in this parameter."
    },
    "IndexName": {
      "type": "string",
      "description": "The name of an index to query. This index can be any local secondary index or global secondary index on the table. Note that if you use the IndexName parameter, you must also provide TableName."
    },
    "Select": {
      "type": "string",
      "enum": [
        "ALL_ATTRIBUTES",
        "ALL_PROJECTED_ATTRIBUTES",
        "SPECIFIC_ATTRIBUTES",
        "COUNT"
      ],
      "description": "The attributes to be returned in the result. You can retrieve all item attributes, specific item attributes, the count of matching items, or in the case of an index, some or all of the attributes projected into the index. ALL_ATTRIBUTES - Returns all of the item attributes from the specified table or index. If you query a local secondary index, then for each matching item in the index, DynamoDB fetches the entire item from the parent table. If the index is configured to project all item attributes, then all of the data can be obtained from the local secondary index, and no fetching is required"
    },
    "AttributesToGet": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "This is a legacy parameter. Use ProjectionExpression instead. For more information, see AttributesToGet in the Amazon DynamoDB Developer Guide."
    },
    "Limit": {
      "type": "integer",
      "description": "The maximum number of items to evaluate (not necessarily the number of matching items). If DynamoDB processes the number of items up to the limit while processing the results, it stops the operation and returns the matching values up to that point, and a key in LastEvaluatedKey to apply in a subsequent operation, so that you can pick up where you left off. Also, if the processed dataset size exceeds 1 MB before DynamoDB reaches this limit, it stops the operation and returns the matching values up to the limit, and a key in LastEvaluatedKey to apply in a subsequent operation to continue the ope"
    },
    "ConsistentRead": {
      "type": "boolean",
      "description": "Determines the read consistency model: If set to true, then the operation uses strongly consistent reads; otherwise, the operation uses eventually consistent reads. Strongly consistent reads are not supported on global secondary indexes. If you query a global secondary index with ConsistentRead set to true, you will receive a ValidationException."
    },
    "KeyConditions": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Condition"
      },
      "description": "This is a legacy parameter. Use KeyConditionExpression instead. For more information, see KeyConditions in the Amazon DynamoDB Developer Guide."
    },
    "QueryFilter": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/Condition"
      },
      "description": "This is a legacy parameter. Use FilterExpression instead. For more information, see QueryFilter in the Amazon DynamoDB Developer Guide."
    },
    "ConditionalOperator": {
      "type": "string",
      "enum": [
        "AND",
        "OR"
      ],
      "description": "This is a legacy parameter. Use FilterExpression instead. For more information, see ConditionalOperator in the Amazon DynamoDB Developer Guide."
    },
    "ScanIndexForward": {
      "type": "boolean",
      "description": "Specifies the order for index traversal: If true (default), the traversal is performed in ascending order; if false, the traversal is performed in descending order. Items with the same partition key value are stored in sorted order by sort key. If the sort key data type is Number, the results are stored in numeric order. For type String, the results are stored in order of UTF-8 bytes. For type Binary, DynamoDB treats each byte of the binary data as unsigned. If ScanIndexForward is true, DynamoDB returns the results in the order in which they are stored (by sort key value). This is the default "
    },
    "ExclusiveStartKey": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/AttributeValue"
      },
      "description": "The primary key of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedKey in the previous operation. The data type for ExclusiveStartKey must be String, Number, or Binary. No set data types are allowed."
    },
    "ReturnConsumedCapacity": {
      "type": "string",
      "enum": [
        "INDEXES",
        "TOTAL",
        "NONE"
      ]
    },
    "ProjectionExpression": {
      "type": "string",
      "description": "A string that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas. If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result. For more information, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide."
    },
    "FilterExpression": {
      "type": "string",
      "description": "A string that contains conditions that DynamoDB applies after the Query operation, but before the data is returned to you. Items that do not satisfy the FilterExpression criteria are not returned. A FilterExpression does not allow key attributes. You cannot define a filter expression based on a partition key or a sort key. A FilterExpression is applied after the items have already been read; the process of filtering does not consume any additional read capacity units. For more information, see Filter Expressions in the Amazon DynamoDB Developer Guide."
    },
    "KeyConditionExpression": {
      "type": "string",
      "description": "The condition that specifies the key values for items to be retrieved by the Query action. The condition must perform an equality test on a single partition key value. The condition can optionally perform one of several comparison tests on a single sort key value. This allows Query to retrieve one item with a given partition key value and sort key value, or several items that have the same partition key value but different sort key values. The partition key equality test is required, and must be specified in the following format: partitionKeyName = :partitionkeyval If you also want to provide "
    },
    "ExpressionAttributeNames": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "One or more substitution tokens for attribute names in an expression. The following are some use cases for using ExpressionAttributeNames: To access an attribute whose name conflicts with a DynamoDB reserved word. To create a placeholder for repeating occurrences of an attribute name in an expression. To prevent special characters in an attribute name from being misinterpreted in an expression. Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name: Percentile The name of this attribute conflicts with a reserved word, so it can"
    },
    "ExpressionAttributeValues": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/AttributeValue"
      },
      "description": "One or more values that can be substituted in an expression. Use the : (colon) character in an expression to dereference an attribute value. For example, suppose that you wanted to check whether the value of the ProductStatus attribute was one of the following: Available | Backordered | Discontinued You would first need to specify ExpressionAttributeValues as follows: { \":avail\":{\"S\":\"Available\"}, \":back\":{\"S\":\"Backordered\"}, \":disc\":{\"S\":\"Discontinued\"} } You could then use these values in an expression, such as this: ProductStatus IN (:avail, :back, :disc) For more information on expression "
    }
  },
  "required": [
    "TableName"
  ],
  "$defs": {
    "AttributeValue": {
      "type": "object",
      "properties": {
        "S": {
          "type": "string",
          "description": "An attribute of type String. For example: \"S\": \"Hello\""
        },
        "N": {
          "type": "string",
          "description": "An attribute of type Number. For example: \"N\": \"123.45\" Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations."
        },
        "B": {
          "type": "string",
          "format": "byte",
          "description": "An attribute of type Binary. For example: \"B\": \"dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk\""
        },
        "SS": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An attribute of type String Set. For example: \"SS\": [\"Giraffe\", \"Hippo\" ,\"Zebra\"]"
        },
        "NS": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "An attribute of type Number Set. For example: \"NS\": [\"42.2\", \"-19\", \"7.5\", \"3.14\"] Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations."
        },
        "BS": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "byte"
          },
          "description": "An attribute of type Binary Set. For example: \"BS\": [\"U3Vubnk=\", \"UmFpbnk=\", \"U25vd3k=\"]"
        },
        "M": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/AttributeValue"
          },
          "description": "An attribute of type Map. For example: \"M\": {\"Name\": {\"S\": \"Joe\"}, \"Age\": {\"N\": \"35\"}}"
        },
        "L": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AttributeValue"
          },
          "description": "An attribute of type List. For example: \"L\": [ {\"S\": \"Cookies\"} , {\"S\": \"Coffee\"}, {\"N\": \"3.14159\"}]"
        },
        "NULL": {
          "type": "boolean",
          "description": "An attribute of type Null. For example: \"NULL\": true"
        },
        "BOOL": {
          "type": "boolean",
          "description": "An attribute of type Boolean. For example: \"BOOL\": true"
        }
      },
      "description": "Exactly one member is set."
    },
    "Condition": {
      "type": "object",
      "properties": {
        "AttributeValueList": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AttributeValue"
          },
          "description": "One or more values to evaluate against the supplied attribute. The number of values in the list depends on the ComparisonOperator being used. For type Number, value comparisons are numeric. String value comparisons for greater than, equals, or less than are based on ASCII character code values. For example, a is greater than A, and a is greater than B. For a list of code values, see http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters. For Binary, DynamoDB treats each byte of the binary data as unsigned when it compares binary values."
        },
        "ComparisonOperator": {
          "type": "string",
          "enum": [
            "EQ",
            "NE",
            "IN",
            "LE",
            "LT",
            "GE",
            "GT",
            "BETWEEN",
            "NOT_NULL",
            "NULL",
            "CONTAINS",
            "NOT_CONTAINS",
            "BEGINS_WITH"
          ],
          "description": "A comparator for evaluating attributes. For example, equals, greater than, less than, etc. The following comparison operators are available: EQ | NE | LE | LT | GE | GT | NOT_NULL | NULL | CONTAINS | NOT_CONTAINS | BEGINS_WITH | IN | BETWEEN The following are descriptions of each comparison operator. EQ : Equal. EQ is supported for all data types, including lists and maps. AttributeValueList can contain only one AttributeValue element of type String, Number, Binary, String Set, Number Set, or Binary Set. If an item contains an AttributeValue element of a different type than the one provided in"
        }
      },
      "required": [
        "ComparisonOperator"
      ]
    }
  }
}