Skip to content

Validate firstEvaluatedKey and lastEvaluatedKey's length #349

Open
@majecty

Description

@majecty

Here is the code that validates firstEvaluatedKey and lastEvaluatedKey.

export const txPaginationSchema = {
    firstEvaluatedKey: Joi.array().items(Joi.number(), Joi.number()),
    lastEvaluatedKey: Joi.array().items(Joi.number(), Joi.number())
};

The above condition does not check an input array's length. All of these inputs [], [1], [1,2] and [1,2,3] are valid in the current implementation. Only [1,2] should pass the validation and other [], [1], [1,2,3] should fail the validation.

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