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

Direct access to structure fields #1628

Open
kubukoz opened this issue Dec 18, 2024 · 1 comment
Open

Direct access to structure fields #1628

kubukoz opened this issue Dec 18, 2024 · 1 comment

Comments

@kubukoz
Copy link
Member

kubukoz commented Dec 18, 2024

It would be "cool" (and probably useful in a bunch of ways) to have access to a particular Field instance, knowing the member name.

For example:

structure Hello {
  @required foo: String = "woop"
}
println(Hello.fields.foo.getDefaultValue: Option[String])

This would sort of mirror how you can already access the individual alts of a generated union shape.

@meldmy
Copy link
Contributor

meldmy commented Dec 18, 2024

We need this feature in our project to avoid duplicating default values in the code base having a smithy with default values

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

No branches or pull requests

2 participants