Repository navigation
Description
Amazon DynamoDB refuses a JSON null in each member below with ValidationException. ExtendDB answers each one with SerializationException and serde's text. #1050 covers the same refusal for a PutItem item attribute and for a Scan AttributesToGet element.
Measured in us-east-1 on 17 Nov 2026, on a table keyed on pk (S), with signed requests that carry the JSON bodies below. Each request went out twice and got the same answer both times. The ExtendDB column comes from a SQLite server built from the fix for #1050, which does not change these members. A server built from origin/main 81e3ebe gave the same answer for the seven of them that went to both.
In the table, NULL stands for The supplied Item contains a null AttributeValue, and ... stands for Start of structure or map found where not expected: invalid type: null, expected.
| Request | DynamoDB | ExtendDB |
|---|---|---|
GetItem "AttributesToGet": [null] |
ValidationException: Empty attribute name |
SerializationException: ... a string |
Query with KeyConditions, "AttributesToGet": [null] |
ValidationException: Empty attribute name |
SerializationException: ... a string |
BatchGetItem, "AttributesToGet": [null] in RequestItems |
ValidationException: Empty attribute name |
SerializationException: ... a string |
GetItem "Key": {"pk": null} |
ValidationException: NULL: pk is null |
SerializationException: ... a DynamoDB AttributeValue map with exactly one type descriptor |
DeleteItem "Key": {"pk": null} |
ValidationException: NULL: pk is null |
the AttributeValue map text of row 4 |
UpdateItem "Key": {"pk": null} |
ValidationException: NULL: pk is null |
the AttributeValue map text of row 4 |
BatchGetItem "Keys": [{"pk": null}] |
ValidationException: NULL: pk is null |
the AttributeValue map text of row 4 |
BatchWriteItem DeleteRequest "Key": {"pk": null} |
ValidationException: NULL: pk is null |
the AttributeValue map text of row 4 |
Scan, FilterExpression a = :v, "ExpressionAttributeValues": {":v": null} |
ValidationException: ExpressionAttributeValues contains invalid value: NULL for key :v |
the AttributeValue map text of row 4 |
PutItem, ConditionExpression a = :v, ":v": null |
ValidationException: ExpressionAttributeValues contains invalid value: NULL for key :v |
the AttributeValue map text of row 4 |
UpdateItem, UpdateExpression SET a = :v, ":v": null |
ValidationException: ExpressionAttributeValues contains invalid value: NULL for key :v |
the AttributeValue map text of row 4 |
BatchWriteItem PutRequest "Item": {"pk": null} |
ValidationException: NULL: pk is null |
the AttributeValue map text of row 4 |
BatchWriteItem PutRequest "Item": {"pk": {"S": "k1"}, "a": null} |
ValidationException: NULL: a is null |
the AttributeValue map text of row 4 |
TransactWriteItems Put "Item": {"pk": null} |
ValidationException: NULL: pk is null |
the AttributeValue map text of row 4 |
TransactWriteItems Put "Item": {"pk": {"S": "k1"}, "a": null} |
ValidationException: NULL: a is null |
the AttributeValue map text of row 4 |
The code at origin/main:
GetItemInput(crates/core/src/types/item.rs, line 190),QueryInput(crates/core/src/types/query.rs, line 96) andKeysAndAttributes(crates/core/src/types/batch.rs, line 33) readAttributesToGetasOption<Vec<String>>, which takes nonullelement.- Keys,
ExpressionAttributeValuesentries and the items of BatchWriteItem and TransactWriteItems go toAttributeValueVisitor(crates/core/src/types/attribute_value.rs, line 69), which takes a map only. deserialize_error(crates/engine/src/lib.rs) maps each of these serde errors toSerializationException.
Proposed change: refuse a null in these members with DynamoDB's texts above, as ValidationException. The readers that the fix for #1050 adds for the PutItem item and the Scan AttributesToGet can serve them.
Activity
LeeroyHannigan commentedon Nov 21, 2026
GetItem with
ProjectionExpression#nandExpressionAttributeNames{"#n": null}answersValidationExceptionExpressionAttributeNames contains invalid value: Empty attribute name for key #non DynamoDB (us-east-1, 2026-11-21, twice). ExtendDB answersSerializationExceptionStart of structure or map found where not expected: invalid type: null, expected a string. On DynamoDB, SearchVectors answers the same request withSerializationExceptioninvalid type: null, expected a string at line 1 column 222, and ExtendDB gives SearchVectors the same type.LeeroyHannigan commentedon Nov 24, 2026
Three more Query members, measured in us-east-1 on 24 November 2026 at 08:58 UTC, with signed requests that carry the JSON bodies below. The
TableNamedoes not exist. Each request went out twice and got the same answer both times. Every body carriesKeyConditionExpression: pk = :pand:pset to{"S": "x"}."ScanIndexForward": nullResourceNotFoundException: Requested resource not foundSerializationException: Start of structure or map found where not expected: invalid type: null, expected a boolean"ExpressionAttributeNames": {"#a": null}ValidationException: ExpressionAttributeNames contains invalid value: Empty attribute name for key #aSerializationException: Start of structure or map found where not expected: invalid type: null, expected a string"ExpressionAttributeNames": {"#a": null}beside:nset to{"N": "bob"}ValidationException: ExpressionAttributeValues contains invalid value: The parameter cannot be converted to a numeric value: bob for key :nexpected a stringtext of row 2DynamoDB reads
"ScanIndexForward": nullas an absent member, so the request reaches the table lookup, as #1050 shows for"ReturnConsumedCapacity": null. It reads a null name as an empty name, and it reports that name after theSelect,ReturnConsumedCapacityand number checks.{"#a": null}besideSelect: "NOPE"orReturnConsumedCapacity: "NOPE"answers that enum's text. Beside{"N": "bob"}it answers the numeric text in theExpressionAttributeValues contains invalid value: ... for keyform, the form DynamoDB uses on its older validation path (#976 shows it beside aLimitabove 2147483647). DynamoDB reports an empty name written as""ahead of those checks instead (measured 19 November 2026, in #544).The code at origin/main:
QueryInput(crates/core/src/types/query.rs) readsScanIndexForwardasboolwith#[serde(default = "default_true")]. serde applies the default to a missing member only, and hands anullto theboolreader.deserialize_expression_names(crates/core/src/serde_helpers.rs) refuses an empty string with theEmpty attribute nametext and hands anullto theStringreader. Its comment says that a non-string matches DynamoDB. For anullit does not.#544 changes the request-time checks only. Beside an invalid enum they now answer the enum text for both members, as main and DynamoDB do. Beside
{"N": "bob"}they answer the bare numeric text. The handler's deserializer still refuses both nulls as above.Proposed change: read
"ScanIndexForward": nullas an absent member, as #1103 does forReturnConsumedCapacity. Read a null name as an empty name and refuse it with theEmpty attribute nametext, after the other request checks. The wrapped numeric text beside a null name belongs to the older validation path and is not part of this proposal.demohan commentedon Nov 25, 2026
Two more shapes for this issue, from a Query on a table that exists (
KeyConditionExpression: "pk = :p",:p = {"S": "x"}). Each was sent twice to the service in us-east-1 and to a SQLite build of #544's head (31c5f3d):ExpressionAttributeNames: {"#a": null},Limit: 01 validation error detected: Value '0' at 'limit' failed to satisfy constraint: Member must have value greater than or equal to 11 validation error detected: Value at 'Limit' failed to satisfy constraint: ...ExpressionAttributeNames: {"#a": null},Select: "NOPE",Limit: 02 validation errors detected: Value 'NOPE' at 'select' ...; Value '0' at 'limit' ...Value at 'Limit'text aloneThe service handles a body with a null name as it handles a value it cannot read as one type: it uses the lowercase
Value '0' at 'limit'form and reports Select and Limit together. The third shape from the same measurement, a null name beside:n = {"N": "bob"}, is the one this issue already lists.