-
Notifications
You must be signed in to change notification settings - Fork 189
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
Support optional URI elements #102
Comments
Interesting. The smithy spec mandates that things marked as
From https://awslabs.github.io/smithy/spec/http.html#httplabel-trait Part number is actually in
Is that modeled correctly? |
The underlying field is unboxed which is why it isn't modeled as |
The actual issue here is that the Http protocol binding traits send |
Closed and opened #108 |
Removes logic from RustWriter that was used to not serialize zero values, ie. 0 for numbers and false for booleans, if that was also the default value for the member. With this change, the only time the default value for a member is not serialized is if the member is also `@clientOptional`. The Blob type was also updated to implement std::Default, since SymbolVisitor treats `""` as a RustDefault. It _seems_ like this logic was originally added to fix issues with [S3](smithy-lang#102) which are technically modeling issues and have since been fixed. However, this change impacts all the protocols and will cause many members to now be sent over the wire that previously weren't.
Removes logic from RustWriter that was used to not serialize zero values, ie. 0 for numbers and false for booleans, if that was also the default value for the member. With this change, the only time the default value for a member is not serialized is if the member is also `@clientOptional`. The Blob type was also updated to implement std::Default, since SymbolVisitor treats `""` as a RustDefault. It _seems_ like this logic was originally added to fix issues with [S3](smithy-lang#102) which are technically modeling issues and have since been fixed. However, this change impacts all the protocols and will cause many members to now be sent over the wire that previously weren't.
Currently, the Rust code generator assumes that all members with the
httpLabel
trait are required. This isn't always true. For example, S3's GetObjectRequest structure bindspartNumber
to a URI element, but it's necessarily optional since it's only accepted when retrieving a single part of a multi-part object. As is, the generated code forces this field to be specified in all requests.I'd say "just examine the member for the
required
trait," but I sadly don't see many models using it. FWIW, The AWS service models bundled with botocore appear to correctly model all required members regardless of where they appear on the wire. Are these service definitions hand-maintained?The text was updated successfully, but these errors were encountered: