aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

BehaviorVersion's interface is not as future-proof as the doc says

Open Ten0 opened this issue 1 year ago • 0 comments
trafficstars

Describe the bug

It is possible to construct a BehaviorVersion:

image

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

Ten0 avatar Mar 25 '24 20:03 Ten0