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

Struct/union name hints #35

Closed
kubukoz opened this issue Jan 9, 2022 · 2 comments · Fixed by #36
Closed

Struct/union name hints #35

kubukoz opened this issue Jan 9, 2022 · 2 comments · Fixed by #36
Labels
bug Something isn't working

Comments

@kubukoz
Copy link
Member

kubukoz commented Jan 9, 2022

It would be great if the Schematic instances for structs generated by smithy4s had a hint for their types' names, or some other way to get that value at any level of the structure.

Currently there's not a (clear?) way to get any of those names, which would be very useful for building tooling / documentation on top of the generated code.

@kubukoz
Copy link
Member Author

kubukoz commented Jan 9, 2022

Looks like this might be just a matter of a missing .withHints(hints) in val schema everywhere? e.g.

val id: smithy4s.ShapeId = smithy4s.ShapeId("smithy4s.example", "ObjectSize")
val underlyingSchema : smithy4s.Schema[Int] = int
val schema : smithy4s.Schema[ObjectSize] = bijection(underlyingSchema, ObjectSize(_), (_ : ObjectSize).value)

@Baccata we talked about this in the context of inputs/outputs only, but it probably applies to everything :) as you've mentioned, this is likely related to #25 - I think hints is now never empty so we should probably render it unconditionally.

@kubukoz kubukoz added the bug Something isn't working label Jan 9, 2022
@Baccata
Copy link
Contributor

Baccata commented Jan 9, 2022

@kubukoz agreed. Additionally, a smoke test related to this would be nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants