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
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).
The text was updated successfully, but these errors were encountered:
An enum identifier like `C5A` is not possible: the `case` library we use
to assert casing will insist you change it to `C5_A`.
Bypass this rule for constant-like values: do a more lenient validation
of our own.
Fixes#3208.
An enum identifier like `C5A` is not possible: the `case` library we use
to assert casing will insist you change it to `C5_A`.
Bypass this rule for constant-like values: do a more lenient validation
of our own.
Fixes#3208.
---
By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].
[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
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.
🐛 Bug Report
Affected Languages
TypeScript
orJavascript
Python
Java
C#
,F#
, ...)Go
General Information
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:It looks like
jsii/packages/jsii/lib/validator.ts
Line 90 in a2bf477
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 replacingCase.constant
with our own code and/or something else).The text was updated successfully, but these errors were encountered: