forked from smithy-lang/smithy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add synthetic box to root intEnums w/o a default (smithy-lang#2053)
Primitive root shapes without the default trait have a synthetic box trait appplied when the shape is built in the loader (see https://github.com/smithy-lang/smithy/blob/d457aabb80feb4088caa3ac27d337b84e3ebc43d/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderShapeMap.java#L366) if the shape would have a default of 0 in Smithy 1.0. Previously, this didn't include intEnum, so if you convert to 1.0, the intEnum which previously had no default in 2.0 will have a default of 0. This commit updates ModelInteropTransformer to consider intEnum as a shape that has a default value in 1.0, so the loader applies the synthetic box trait to root intEnums. Tests were updated to make sure box is added to root intEnums, and to fix some incorrect assertions.
- Loading branch information
1 parent
88b205f
commit 45ff12c
Showing
4 changed files
with
57 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
6 changes: 3 additions & 3 deletions
6
...e/amazon/smithy/model/loader/upgrade-box/2-to-1/intEnumSetToZeroValueToNonNullable.smithy
This file contains 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
This file contains 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