Repository navigation
docs: clarify fluent API guideline rationale - #38811
Conversation
The stated reason for the no-fluent-API rule was incorrect: jsii handles method chaining that returns `this` in all target languages (verified in Python, Java, C#, and Go). The real reason is API consistency, since the library configures through props objects at construction time. Soften the rule to SHOULD NOT with a written-justification requirement, accepted at maintainer discretion, and correct the rationale in both the design guidelines and AGENTS.md.
|
PRs without a linked issue will receive lower priority for review and merging. Please update the description to follow the PR template and include a line like |
|
Automated review A maintainer will still review this — treat the notes below as a starting point. This docs-only PR clarifies the CDK design guideline on fluent APIs across two files. In 🔴 0 blocking · 🟡 0 recommended · ⚪ 0 optional Generated automatically. React 👍 or 👎 to tell us whether this review helped, so we can improve these reviews. |
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 26 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Reason for this change
The stated rationale for the no-fluent-API rule was wrong. It claimed jsii languages cannot chain methods that return
this, but chaining works fine in all jsii targets (verified in Python, Java, C#, and Go). The actual reason is API consistency: the library configures through props objects at construction time.Description of changes
Correct the rationale and soften the rule from a hard prohibition to SHOULD NOT, in both
docs/DESIGN_GUIDELINES.mdandAGENTS.md. A fluent API is now allowed with a written justification, accepted at maintainer discretion.Description of how you validated changes
Docs-only change.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license