Skip to content

Bad validation on Global Secondary Indexes #184

@reconbot

Description

@reconbot

Describe the issue
I added a global secondary index in development using Dynalite and when I went to production I had issues because I wasn't always providing data for the hashkey in the GSI. However the value wasn't undefined but instead an empty string.

In development it didn't care, in production I got this error on put;

One or more parameter values are not valid. A value specified for a secondary index key is not supported. The AttributeValue for a key attribute cannot contain an empty string value. IndexName: gsi2, IndexKey: gsi2pk

Steps to reproduce
Steps to reproduce the behavior:

  1. create a table with a global secondary index with string hash and sort keys
  2. put a record that's got empty string values for those fields
  3. Look to get an error, but get a successful put

Expected behavior
An error on put

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions