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 support for unsigned types. #1836

Open
Nicolas-GUILLAUME opened this issue Oct 10, 2022 · 2 comments
Open

Add support for unsigned types. #1836

Nicolas-GUILLAUME opened this issue Oct 10, 2022 · 2 comments
Labels
customer-request enhancement New feature or request

Comments

@Nicolas-GUILLAUME
Copy link

We have a use case where our system mostly uses unsigned types.

This forces us to covert all our unsigned types into signed types. So far we've made it work but this will become a problem for us at some point.

If "native" support is not an option it would be nice to have a way to do it via a custom code generator.

@jdisanti jdisanti added enhancement New feature or request customer-request labels Oct 10, 2022
@jdisanti
Copy link
Collaborator

It seems like it should be possible to implement this as a plugin to smithy-rs, but the RustCodegenDecorator doesn't appear to have a way to augment the SymbolProvider implementation.

It doesn't look like adding this support should be too difficult. The symbol provider is currently resolved from the root plugin. We should be able to add a method to RustCodegenDecorator that takes a base symbol provider as an argument, and returns an updated/revised symbol provider, and then call that in CodegenVisitor. I think that should unblock this use case, although there may be other snags we aren't aware of yet.

@david-perez
Copy link
Contributor

There was some discussion on whether @range(min: 0) should generate unsigned integers in this thread. There's an unresolved question of what to do with e.g. u32 values that do not fit within what the Smithy spec says the range of the integer shape is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-request enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants