You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make OperationExtension store the absolute shape ID (#2276)
* Do not alter Operation shape ID
* Add OperationExtensionExt test
* Add CHANGELOG.next.toml entry
* Apply suggestions from code review
Co-authored-by: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>
---------
Co-authored-by: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com>
Fix `name` and `absolute` methods on `OperationExtension`.
89
+
90
+
The older, [now removed](https://github.com/awslabs/smithy-rs/pull/2161), service builder would insert `OperationExtension` into the `http::Response` containing the [absolute shape ID](https://smithy.io/2.0/spec/model.html#grammar-token-smithy-AbsoluteRootShapeId) with the `#` symbol replaced with a `.`. When [reintroduced](https://github.com/awslabs/smithy-rs/pull/2157) into the new service builder machinery the behavior was changed - we now do _not_ perform the replace. This change fixes the documentation and `name`/`absolute` methods of the `OperationExtension` API to match this new behavior.
91
+
92
+
In the old service builder, `OperationExtension` was initialized, by the framework, and then used as follows:
93
+
94
+
```rust
95
+
let ext = OperationExtension::new("com.amazonaws.CompleteSnapshot");
96
+
97
+
// This is expected
98
+
let name = ext.name(); // "CompleteSnapshot"
99
+
let namespace = ext.namespace(); // = "com.amazonaws";
100
+
```
101
+
102
+
When reintroduced, `OperationExtension` was initialized by the `Plugin` and then used as follows:
103
+
104
+
```rust
105
+
let ext = OperationExtension::new("com.amazonaws#CompleteSnapshot");
106
+
107
+
// This is the bug
108
+
let name = ext.name(); // "amazonaws#CompleteSnapshot"
109
+
let namespace = ext.namespace(); // = "com";
110
+
```
111
+
112
+
The intended behavior is now restored:
113
+
114
+
```rust
115
+
let ext = OperationExtension::new("com.amazonaws#CompleteSnapshot");
116
+
117
+
// This is expected
118
+
let name = ext.name(); // "CompleteSnapshot"
119
+
let namespace = ext.namespace(); // = "com.amazonaws";
120
+
```
121
+
122
+
The rationale behind this change is that the previous design was tailored towards a specific internal use case and shouldn't be enforced on all customers.
0 commit comments