aws / aws-cli

Universal Command Line Interface for Amazon Web Services
Other
15.61k stars 4.14k forks source link

iot update-event-configurations shorthand syntax mismatch between docs and actual functionality #7433

Open uhinze opened 2 years ago

uhinze commented 2 years ago

Describe the bug

Doc: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/iot/update-event-configurations.html

Quote:

Shorthand Syntax:

KeyName1=Enabled=boolean,KeyName2=Enabled=boolean

Where valid key names are: THING THING_GROUP THING_TYPE ...

But when I do: aws iot update-event-configurations --event-configurations THING_TYPE=Enabled=True (or true), I get back:

Parameter validation failed:
Invalid type for parameter eventConfigurations.THING_TYPE, value: Enabled=True, type: <class 'str'>, valid types: <class 'dict'>

What works is either the JSON syntax or a slightly modified shorthand syntax like this: aws iot update-event-configurations --event-configurations "THING_TYPE={Enabled=True}.

Expected Behavior

No error when issuing a command described in docs

Current Behavior

Error when issuing a shorthand syntax command

Reproduction Steps

aws iot update-event-configurations --event-configurations THING_TYPE=Enabled=true

Possible Solution

Either doc or implementation fix

Additional Information/Context

No response

CLI version used

aws-cli/2.8.12

Environment details (OS name and version, etc.)

macOS 12.5.1

tim-finnigan commented 2 years ago

Hi @uhinze thanks for reporting this. It seems this is due to an issue with how the shorthand syntax docs are generated when nested maps are involved. Other documentation pages affected include SQS, SNS, and EC2. Some further investigation is required before a fix is implemented.

wangshu3000 commented 2 years ago

Tried to fix this in this PR. Can anyone please have a review? https://github.com/aws/aws-cli/pull/7286/files