Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate firstEvaluatedKey and lastEvaluatedKey's length #349

Open
majecty opened this issue Nov 20, 2019 · 0 comments
Open

Validate firstEvaluatedKey and lastEvaluatedKey's length #349

majecty opened this issue Nov 20, 2019 · 0 comments

Comments

@majecty
Copy link
Contributor

majecty commented Nov 20, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant