Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enum value names #304

Merged
merged 1 commit into from
Jul 12, 2022
Merged

Add enum value names #304

merged 1 commit into from
Jul 12, 2022

Conversation

kubukoz
Copy link
Member

@kubukoz kubukoz commented Jul 12, 2022

No description provided.

@@ -575,9 +575,10 @@ private[codegen] class Renderer(compilationUnit: CompilationUnit) { self =>
hints: List[Hint]
): Lines = lines(
block(
line"sealed abstract class $name(_value: String, _ordinal: Int) extends $Enumeration_.Value"
line"sealed abstract class $name(_value: String, _name: String, _ordinal: Int) extends $Enumeration_.Value"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't decide on whether this should be optional or not.

Against optionality:

  • smithy 2 enums seem to enforce names
  • cleaner API, consistent usage among implementations that read this field

For optionality:

  • smithy 1 enums don't enforce names (unless you provide at least one of them)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah I'm cool with planning ahead.

@Baccata Baccata merged commit 0b8a969 into disneystreaming:main Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants