Fix `SDK::Endpoint` built-in (#2935)
Setting `endpoint_url` on a SDK Config currently has no effect due to a bug in deciding if a parameter is a built-in or not in EndpointBuiltinsDecorator. The generated code is placing the endpoint URL into the ConfigBag with the correct `aws_types::endpoint_config::EndpointUrl` type, but then the operation runtime plugin is trying to pull it out of the ConfigBag with the `crate::config::EndpointUrl` type, which always yields nothing. Or, to illustrate with the generated code itself: ``` pub fn set_endpoint_url(&mut self, endpoint_url: Option<::std::string::String>) -> &mut Self { self.config.store_or_unset(endpoint_url.map(::aws_types::endpoint_config::EndpointUrl)); self } ``` vs. ``` let params = crate::config::endpoint::Params::builder() .set_endpoint(cfg.load::<crate::config::EndpointUrl>().map(|ty| ty.0.clone())) ``` This PR adds a unit test that reproduces the issue, and then fixes it. ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
Loading
Please register or sign in to comment