Skip to content

Commit df55c0b

Browse files
david-perezaws-sdk-rust-ci
authored andcommitted
[smithy-rs] Fix server code generation of @httpPayload-bound constrained shapes (#2584)
The issue is we're not changing the return type of the payload deserializing function to be the unconstrained type (e.g. the builder in case of an `@httpPayload`-bound structure shape) when the shape is constrained. Yet another example of why code-generating `constraints.smithy` (see #2101) is important. Closes #2583. ## Testing The added integration test operation fails to compile without this patch. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 43c7996 commit df55c0b

File tree

367 files changed

+389
-389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

367 files changed

+389
-389
lines changed

sdk/amplifyuibuilder/src/protocol_serde/shape_component.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_component_payload(input: &[u8]) -> Result<crate::types::Component, aws_smithy_json::deserialize::error::DeserializeError> {
2+
pub(crate) fn de_component_payload(input: &[u8]) -> Result<crate::types::Component, aws_smithy_json::deserialize::error::DeserializeError> {
33
let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input)).peekable();
44
let tokens = &mut tokens_owned;
55
let result =

sdk/amplifyuibuilder/src/protocol_serde/shape_create_component_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Component>, crate::operation::create_component::CreateComponentError> {
2+
pub(crate) fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Component>, crate::operation::create_component::CreateComponentError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_component::de_component_payload(body).map_err(crate::operation::create_component::CreateComponentError::unhandled)
55
}).transpose()

sdk/amplifyuibuilder/src/protocol_serde/shape_create_form_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Form>, crate::operation::create_form::CreateFormError> {
2+
pub(crate) fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Form>, crate::operation::create_form::CreateFormError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_form::de_form_payload(body).map_err(crate::operation::create_form::CreateFormError::unhandled)
55
}).transpose()

sdk/amplifyuibuilder/src/protocol_serde/shape_create_theme_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Theme>, crate::operation::create_theme::CreateThemeError> {
2+
pub(crate) fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Theme>, crate::operation::create_theme::CreateThemeError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_theme::de_theme_payload(body).map_err(crate::operation::create_theme::CreateThemeError::unhandled)
55
}).transpose()

sdk/amplifyuibuilder/src/protocol_serde/shape_form.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_form_payload(input: &[u8]) -> Result<crate::types::Form, aws_smithy_json::deserialize::error::DeserializeError> {
2+
pub(crate) fn de_form_payload(input: &[u8]) -> Result<crate::types::Form, aws_smithy_json::deserialize::error::DeserializeError> {
33
let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input)).peekable();
44
let tokens = &mut tokens_owned;
55
let result =

sdk/amplifyuibuilder/src/protocol_serde/shape_get_component_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_component_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Component>, crate::operation::get_component::GetComponentError> {
2+
pub(crate) fn de_component_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Component>, crate::operation::get_component::GetComponentError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_component::de_component_payload(body).map_err(crate::operation::get_component::GetComponentError::unhandled)
55
}).transpose()

sdk/amplifyuibuilder/src/protocol_serde/shape_get_form_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_form_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Form>, crate::operation::get_form::GetFormError> {
2+
pub(crate) fn de_form_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Form>, crate::operation::get_form::GetFormError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_form::de_form_payload(body).map_err(crate::operation::get_form::GetFormError::unhandled)
55
}).transpose()

sdk/amplifyuibuilder/src/protocol_serde/shape_get_theme_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_theme_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Theme>, crate::operation::get_theme::GetThemeError> {
2+
pub(crate) fn de_theme_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Theme>, crate::operation::get_theme::GetThemeError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_theme::de_theme_payload(body).map_err(crate::operation::get_theme::GetThemeError::unhandled)
55
}).transpose()

sdk/amplifyuibuilder/src/protocol_serde/shape_theme.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_theme_payload(input: &[u8]) -> Result<crate::types::Theme, aws_smithy_json::deserialize::error::DeserializeError> {
2+
pub(crate) fn de_theme_payload(input: &[u8]) -> Result<crate::types::Theme, aws_smithy_json::deserialize::error::DeserializeError> {
33
let mut tokens_owned = aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input)).peekable();
44
let tokens = &mut tokens_owned;
55
let result =

sdk/amplifyuibuilder/src/protocol_serde/shape_update_component_output.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2-
pub fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Component>, crate::operation::update_component::UpdateComponentError> {
2+
pub(crate) fn de_entity_payload(body: &[u8]) -> std::result::Result<std::option::Option<crate::types::Component>, crate::operation::update_component::UpdateComponentError> {
33
(!body.is_empty()).then(||{
44
crate::protocol_serde::shape_component::de_component_payload(body).map_err(crate::operation::update_component::UpdateComponentError::unhandled)
55
}).transpose()

0 commit comments

Comments
 (0)