Skip to content

Fix generate-cli-skeleton output min constraints - #10677

Open
HuzaifaChaudary wants to merge 1 commit into
aws:v2from
HuzaifaChaudary:fix/generate-cli-skeleton-output-min
Open

HuzaifaChaudary wants to merge 1 commit into
aws:v2from
HuzaifaChaudary:fix/generate-cli-skeleton-output-min

Conversation

@HuzaifaChaudary

Copy link
Copy Markdown

Issue #, if available: fixes #2337

Description of changes:

the sample response for --generate-cli-skeleton output is built from the member names of the output shape and from zeros , and the stubber then validates that response against the same shape . a placeholder that is shorter than the min of its shape , or a number below it , makes the command fail on its own sample data :

$ aws iam list-roles --generate-cli-skeleton output
Invalid length for parameter Roles[0].RoleId, value: 6, valid min length: 16
Invalid value for parameter Roles[0].MaxSessionDuration, value: 0, valid min value: 3600

the generator used for the stubbed response now pads a string that is too short , raises a number to the minimum and fills a list up to the minimum number of items . the input skeletons are untouched , this only changes the sample response .

of the 17737 operations that have an output shape , 4638 failed this validation before the change and 805 after it . every remaining one is a tagged union , where the skeleton sets all the members and the validator wants one , which is a separate problem and not fixed here .

iam list-roles now prints "RoleId": "RoleIdxxxxxxxxxx" and "MaxSessionDuration": 3600 instead of failing . two functional tests cover a short string and a small number , and the unit tests cover strings , integers , doubles , lists , map keys and nested structures . both new functional tests fail with the old generator wired back in .

generated by AI tools ( claude code , claude opus 5 ) , and reviewed by Huzaifa Iftikhar .

Testing:

pytest tests/unit tests/functional is 98601 passed , 10 skipped , 0 failed .


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The sample response for --generate-cli-skeleton output is built from the
member names of the output shape and from zeros, and the stubber then
validates that response against the same shape. A placeholder that is
shorter than the min of its shape, or a number below it, makes the command
fail on its own sample data:

    $ aws iam list-roles --generate-cli-skeleton output
    Invalid length for parameter Roles[0].RoleId, value: 6,
        valid min length: 16
    Invalid value for parameter Roles[0].MaxSessionDuration, value: 0,
        valid min value: 3600

The generator used for the stubbed response now pads a string that is too
short, raises a number to the minimum and fills a list up to the minimum
number of items. Of the 17737 operations that have an output shape, 4638
failed this validation before the change and 805 after it, and every
remaining one is a tagged union, which is a separate problem.

fixes aws#2337

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@HuzaifaChaudary
HuzaifaChaudary requested a review from a team as a code owner September 22, 2026 17:46
Copilot AI lite review requested due to automatic review settings September 22, 2026 17:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants