aws / aws/aws-cli

--cli-input-json error message very misleading

Open
#3,491 23 comments 80 reactions 0 assignees View on GitHub
confusing-error enhancement feature-request p2
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

I am new to aws cli, and recently discovered the --cli-input-json parameters. I admit that I jumped in without fully read the document, but then, when I firstly specified a file name of my JSON document to the parameter (I guess lots programmers will do the same in the first attempt without reading the documentation), as follows:

aws dynamodb create-table --cli-input-json awscli-jsons/dynamodb-create-table-contact.json

The error message I received would be like:

Error parsing parameter 'cli-input-json': Invalid JSON: No JSON object could be decoded
JSON received: awscli-jsons/dynamodb-create-table-contact.json

In every way the message seems like indicates the file format was wrong, not a valid JSON file, and cannot be parsed. I studied the documents from "aws dynamodb create-table help" and still was given no clue. Much time was spent until I find that I should issue the command as:

aws dynamodb create-table --cli-input-json file://awscli-jsons/dynamodb-create-table-contact.json

Firstly, such important information (using file://), which is different from the norm (in most cases we expect providing the file name), should be mentioned in the command help. Then, the error message is very misleading, points to a wrong direction.

Please enhance this behavior.

Thanks

Bing

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.