Repository navigation
fix(E3001): allow a string resource-level Description - #4922
Merged
kddejong merged 1 commit intoOct 26, 2026
Merged
Conversation
CloudFormation accepts a string Description on any resource and aws-cdk-lib writes it from cfnOptions.description, but other/resources/configuration.json did not list it, so E3001 reported it as an unexpected property. Add it as a string so any other value still fails the type check. Signed-off-by: Youssef Omar Bouden <youssef.bouden2002@gmail.com>
kddejong
approved these changes
Oct 26, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4922 +/- ##
=======================================
Coverage 94.68% 94.68%
=======================================
Files 439 439
Lines 16016 16016
Branches 3111 3111
=======================================
Hits 15165 15165
Misses 468 468
Partials 383 383
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kddejong
added a commit
that referenced
this pull request
Oct 26, 2026
PR #4922 closed issue #4766 by adding Description to the resource configuration schema, which also made a resource-level Description on an AWS::Serverless::* resource silent instead of W3001. That is correct -- CloudFormation accepts, type-checks and discards the attribute on every resource type, so the discard is not the SAM transform's doing -- but #4922 made the change by swapping Description out of the existing tests for other stray keys, so nothing pinned the new behavior. Add a test asserting AWS::Serverless::Function with a string resource-level Description produces neither W3001 nor E3001.
Contributor
Author
|
Thanks @kddejong for the quick review and merge. |
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.
Issue #, if available: #4766
Description of changes:
other/resources/configuration.jsondid not listDescription, so a string resource-levelDescriptionreported E3001Additional properties are not allowed ('Description' was unexpected). CloudFormation accepts the key and type-checks it, and aws-cdk-lib writes it fromcfnOptions.description.The schema now has
Descriptionas astring. A string value passes; any other value still reports E3001, now asis not of type 'string'on theDescriptionpath, which matches theEvery Description member must be a stringerror CloudFormation returns.Tests:
test_resource_level_descriptioncovers the two templates from the issue and a non-string value. The existing W3001 and E3001 tests usedDescriptionas their stray key, so they now use other keys (Handler,Name,Comment,Timeout) and keep their intent. OnAWS::Serverless::*resources a stringDescriptionis accepted as well and no longer reports W3001; the SAM transform drops it like any other attribute outside its five supported ones, so the warning can be kept for SAM resources with a type-conditional in the schema if you prefer that.Verified on the issue's template: no finding for the two string descriptions,
E3001 ['resource level description'] is not of type 'string'for a list value.pytestfor the full unit suite passes locally.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.