Add enum support to byte, short, int, and long
See original GitHub issueThe enum trait today can only be attached to a string shape. Updating this trait to also support byte, short, int, and long would make it support a broader range of uses cases that involve a finite set of numeric values.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Specifying size of enum type in C - Stack Overflow
Allocate to an enum type only as many bytes as it needs for the declared range of possible values. Specifically, the enum type...
Read more >Enumeration types - C# reference - Microsoft Learn
Learn about C# enumeration types that represent a choice or a combination of choices.
Read more >Enumeration declaration - cppreference.com
1) Declares an unscoped enumeration type whose underlying type is not fixed (in this case, the underlying type is an implementation-defined ...
Read more >C# Enumerations Type - Enum - TutorialsTeacher
The enum can be of any numeric data type such as byte, sbyte, short, ushort, int, uint, long, or ulong. However, an enum...
Read more >The switch Statement (The Java™ Tutorials > Learning the ...
A switch works with the byte , short , char , and int primitive data types. It also works with enumerated types (discussed...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

We have intEnum and string enums now in Smithy IDL 2.0. Each new shape requires a new type, we have to do tricky things like subclass an existing type (e.g., intEnum extends from integer, and string enum extends from string), and each type is more overhead for people trying to figure out how Smithy works. I think intEnum and string enums cover the vast majority of use cases, so I don’t think there would be alot of value in expanding enums to support all these types.
thank you! that solves my issue - must have missed it in the documentation
I’ll leave it here in case someone else finds this issue looking for the same information: https://awslabs.github.io/smithy/2.0/spec/simple-types.html#intenum