You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: enum validation picks odd convention for members with digits #3208
JSII Version: (Not yet released as of this writing)
Platform: N/A
What is the problem?
jsii enforces a kind of odd convention for enum names, and the error message does not reflect the actual validation. See the below:
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C5A" to "C5_A"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C5AD" to "C5_A_D"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C5D" to "C5_D"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C5N" to "C5_N"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C6G" to "C6_G"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C6GD" to "C6_G_D"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C6GN" to "C6_G_N"
error JSII8001: Enum members must be ALL_CAPS. Rename "aws-cdk-lib.aws_ec2.InstanceClass.C6I" to "C6_I"
is the culprit. Our use of Case.constant() wants to introduce these underscores.
The above are live values in the aws-cdk, but they haven't been a problem to date because of #2782. However, I just tested the fix (#3207), and the CDK build fails due to the above. Given that our JS/TS users are able to use the values (e.g., C5A), we can't rename them, as it would be a breaking change. Instead, I propose we update the validation to support this case (likely replacing Case.constant with our own code and/or something else).
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Activity
fix(jsii): constants can't mix letters and digits
fix(jsii): constants can't mix letters and digits (#3209)
github-actions commentedon Nov 26, 2021
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.