Skip to content
Unverified Commit 9570983e authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

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._
parent c742b5f6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment