question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add enum support to byte, short, int, and long

See original GitHub issue

The 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:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mtdowlingcommented, Aug 13, 2022

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.

0reactions
akdev1lcommented, Aug 13, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found