aws-sdk-rust
aws-sdk-rust copied to clipboard
BehaviorVersion's interface is not as future-proof as the doc says
trafficstars
Describe the bug
It is possible to construct a BehaviorVersion:
Using the following syntax:
let behavior: BehaviorVersion = BehaviorVersion {};
While the documentation says that latest may change behavior but v2023_11_09 would keep its behavior, that is impossible because one cannot add new fields to BehaviorVersion without that being a breaking change due to the currently allowed explicit construction.
Expected Behavior
let behavior: BehaviorVersion = BehaviorVersion {};
should not compile, one should be forced to use either latest or v2023_11_09 to instantiate a BehaviorVersion.
Current Behavior
compiles
Possible Solution
That should be achieved by defining the struct as so:
pub struct BehaviorVersion {
_private: (),
}
Additional Information/Context
This is technically a breaking change but since this was released recently and it's documented that this API shouldn't be used, better now than later.
Version
AWS SDK 1.1.8