Repository navigation
fix(aws-cdk): scope --json to commands that honor it - #2068
Open
Mr-Perfectuz wants to merge 1 commit into
Open
Mr-Perfectuz wants to merge 1 commit into
Mr-Perfectuz wants to merge 1 commit into
Conversation
Move --json off the global option list so unsupported commands warn instead of silently ignoring it. Fixes aws#1695. Co-authored-by: Cursor <cursoragent@cursor.com>
Mr-Perfectuz
temporarily deployed
to
automation
October 21, 2026 01:22 — with
GitHub Actions
Inactive
Mr-Perfectuz
had a problem deploying
to
automation
October 21, 2026 01:22 — with
GitHub Actions
Failure
aws-cdk-automation
enabled auto-merge
October 21, 2026 01:22
Mr-Perfectuz
requested a deployment
to
integ-approval
October 21, 2026 01:22 — with
GitHub Actions
Waiting
This branch is waiting to be deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1695
Reason for this change
--json/-jwas registered as a global CLI option, so every command accepted it even though onlycontext,list/ls,bootstrap,synth/synthesize, andmetadataactually use it. On other commands the flag was a silent no-op, which is misleading for machine-readable workflows.Description of changes
--jsonfrom global options incli-config.tsonto the five commands that honor ituser-input-gen--jsonBehavioral notes:
cdk <command> --json(or-j)cdk deploy --json) now emit the existing unknown-option warning instead of being silently ignoredcdk --json <command>no longer works, because--jsonis no longer global; put the flag after the commandNo dependency or IAM permission changes are included.
Validation
cli-config.tsviascripts/user-input-gen.tsyarn compileinpackages/aws-cdkcli-arguments.test.ts(16 passed) andcheck-unknown-options.test.ts(23 passed)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license