Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943

Files changed:

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_internal_server_error.rs

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_internal_server_error_error(
    3      4   
    value: &crate::error::InternalServerError,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_internal_server_error::ser_internal_server_error(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_internal_server_error(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::InternalServerError,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("message").string(input.message.as_str());
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_list_a.rs

@@ -1,1 +59,85 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_a<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::vec::Vec<
    7      8   
            ::std::vec::Vec<
    8      9   
                ::std::vec::Vec<
    9     10   
                    ::std::collections::HashMap<
   10     11   
                        ::std::string::String,
   11     12   
                        crate::model::EmptyStructure,
   12     13   
                    >,
   13     14   
                >,
   14     15   
            >,
   15     16   
        >,
   16     17   
    >,
   17     18   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   18     19   
>
   19     20   
where
   20     21   
    I: Iterator<
   21     22   
        Item = Result<
   22     23   
            ::aws_smithy_json::deserialize::Token<'a>,
   23     24   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   24     25   
        >,
   25     26   
    >,
   26     27   
{
          28  +
    /* JsonParserGenerator.kt:712 */
   27     29   
    match tokens.next().transpose()? {
          30  +
        /* JsonParserGenerator.kt:713 */
   28     31   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   29     32   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          33  +
            /* JsonParserGenerator.kt:407 */
   30     34   
            let mut items = Vec::new();
          35  +
            /* JsonParserGenerator.kt:408 */
   31     36   
            loop {
          37  +
                /* JsonParserGenerator.kt:409 */
   32     38   
                match tokens.peek() {
          39  +
                    /* JsonParserGenerator.kt:410 */
   33     40   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          41  +
                        /* JsonParserGenerator.kt:411 */
   34     42   
                        tokens.next().transpose().unwrap();
   35     43   
                        break;
          44  +
                        /* JsonParserGenerator.kt:410 */
   36     45   
                    }
          46  +
                    /* JsonParserGenerator.kt:413 */
   37     47   
                    _ => {
   38         -
                        let value = crate::protocol_serde::shape_list_b::de_list_b(tokens)?;
          48  +
                        /* JsonParserGenerator.kt:419 */
          49  +
                        let value =
          50  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_b::de_list_b(tokens)?
          51  +
                        /* JsonParserGenerator.kt:419 */;
          52  +
                        /* JsonParserGenerator.kt:422 */
   39     53   
                        if let Some(value) = value {
   40     54   
                            items.push(value);
   41         -
                        } else {
          55  +
                        }
          56  +
                        /* JsonParserGenerator.kt:430 */
          57  +
                        else {
   42     58   
                            return Err(
   43     59   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44     60   
                                    "dense list cannot contain null values",
   45     61   
                                ),
   46     62   
                            );
   47     63   
                        }
   48         -
                    }
          64  +
                        /* JsonParserGenerator.kt:413 */
          65  +
                    } /* JsonParserGenerator.kt:409 */
   49     66   
                }
          67  +
                /* JsonParserGenerator.kt:408 */
   50     68   
            }
          69  +
            /* JsonParserGenerator.kt:446 */
   51     70   
            Ok(Some(items))
          71  +
            /* JsonParserGenerator.kt:713 */
   52     72   
        }
   53         -
        _ => Err(
   54         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   55         -
                "expected start array or null",
   56         -
            ),
   57         -
        ),
          73  +
        /* JsonParserGenerator.kt:722 */
          74  +
        _ => {
          75  +
            /* JsonParserGenerator.kt:723 */
          76  +
            Err(
          77  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          78  +
                    "expected start array or null",
          79  +
                ),
          80  +
            )
          81  +
            /* JsonParserGenerator.kt:722 */
          82  +
        } /* JsonParserGenerator.kt:712 */
   58     83   
    }
          84  +
    /* JsonParserGenerator.kt:398 */
   59     85   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_list_b.rs

@@ -1,1 +54,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_b<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::vec::Vec<
    7      8   
            ::std::vec::Vec<
    8      9   
                ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
    9     10   
            >,
   10     11   
        >,
   11     12   
    >,
   12     13   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
>
   14     15   
where
   15     16   
    I: Iterator<
   16     17   
        Item = Result<
   17     18   
            ::aws_smithy_json::deserialize::Token<'a>,
   18     19   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   19     20   
        >,
   20     21   
    >,
   21     22   
{
          23  +
    /* JsonParserGenerator.kt:712 */
   22     24   
    match tokens.next().transpose()? {
          25  +
        /* JsonParserGenerator.kt:713 */
   23     26   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   24     27   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          28  +
            /* JsonParserGenerator.kt:407 */
   25     29   
            let mut items = Vec::new();
          30  +
            /* JsonParserGenerator.kt:408 */
   26     31   
            loop {
          32  +
                /* JsonParserGenerator.kt:409 */
   27     33   
                match tokens.peek() {
          34  +
                    /* JsonParserGenerator.kt:410 */
   28     35   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          36  +
                        /* JsonParserGenerator.kt:411 */
   29     37   
                        tokens.next().transpose().unwrap();
   30     38   
                        break;
          39  +
                        /* JsonParserGenerator.kt:410 */
   31     40   
                    }
          41  +
                    /* JsonParserGenerator.kt:413 */
   32     42   
                    _ => {
   33         -
                        let value = crate::protocol_serde::shape_list_c::de_list_c(tokens)?;
          43  +
                        /* JsonParserGenerator.kt:419 */
          44  +
                        let value =
          45  +
                            /* JsonParserGenerator.kt:451 */crate::protocol_serde::shape_list_c::de_list_c(tokens)?
          46  +
                        /* JsonParserGenerator.kt:419 */;
          47  +
                        /* JsonParserGenerator.kt:422 */
   34     48   
                        if let Some(value) = value {
   35     49   
                            items.push(value);
   36         -
                        } else {
          50  +
                        }
          51  +
                        /* JsonParserGenerator.kt:430 */
          52  +
                        else {
   37     53   
                            return Err(
   38     54   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   39     55   
                                    "dense list cannot contain null values",
   40     56   
                                ),
   41     57   
                            );
   42     58   
                        }
   43         -
                    }
          59  +
                        /* JsonParserGenerator.kt:413 */
          60  +
                    } /* JsonParserGenerator.kt:409 */
   44     61   
                }
          62  +
                /* JsonParserGenerator.kt:408 */
   45     63   
            }
          64  +
            /* JsonParserGenerator.kt:446 */
   46     65   
            Ok(Some(items))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
   49         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50         -
                "expected start array or null",
   51         -
            ),
   52         -
        ),
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
          72  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          73  +
                    "expected start array or null",
          74  +
                ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_list_c.rs

@@ -1,1 +52,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_list_c<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<
    6      7   
        ::std::vec::Vec<
    7      8   
            ::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>,
    8      9   
        >,
    9     10   
    >,
   10     11   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   11     12   
>
   12     13   
where
   13     14   
    I: Iterator<
   14     15   
        Item = Result<
   15     16   
            ::aws_smithy_json::deserialize::Token<'a>,
   16     17   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   17     18   
        >,
   18     19   
    >,
   19     20   
{
          21  +
    /* JsonParserGenerator.kt:712 */
   20     22   
    match tokens.next().transpose()? {
          23  +
        /* JsonParserGenerator.kt:713 */
   21     24   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   22     25   
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
          26  +
            /* JsonParserGenerator.kt:407 */
   23     27   
            let mut items = Vec::new();
          28  +
            /* JsonParserGenerator.kt:408 */
   24     29   
            loop {
          30  +
                /* JsonParserGenerator.kt:409 */
   25     31   
                match tokens.peek() {
          32  +
                    /* JsonParserGenerator.kt:410 */
   26     33   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          34  +
                        /* JsonParserGenerator.kt:411 */
   27     35   
                        tokens.next().transpose().unwrap();
   28     36   
                        break;
          37  +
                        /* JsonParserGenerator.kt:410 */
   29     38   
                    }
          39  +
                    /* JsonParserGenerator.kt:413 */
   30     40   
                    _ => {
   31         -
                        let value = crate::protocol_serde::shape_map_a::de_map_a(tokens)?;
          41  +
                        /* JsonParserGenerator.kt:419 */
          42  +
                        let value =
          43  +
                            /* JsonParserGenerator.kt:509 */crate::protocol_serde::shape_map_a::de_map_a(tokens)?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
   41         -
                    }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   42     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   43     61   
            }
          62  +
            /* JsonParserGenerator.kt:446 */
   44     63   
            Ok(Some(items))
          64  +
            /* JsonParserGenerator.kt:713 */
   45     65   
        }
   46         -
        _ => Err(
   47         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48         -
                "expected start array or null",
   49         -
            ),
   50         -
        ),
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
          70  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          71  +
                    "expected start array or null",
          72  +
                ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   51     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   52     78   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_map_a.rs

@@ -1,1 +59,83 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_a<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<::std::collections::HashMap<::std::string::String, crate::model::EmptyStructure>>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:348 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
   25     38   
                        let value =
   26         -
                            crate::protocol_serde::shape_empty_structure::de_empty_structure(
   27         -
                                tokens,
   28         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_empty_structure::de_empty_structure(tokens)?
          40  +
                        /* JsonParserGenerator.kt:474 */;
          41  +
                        /* JsonParserGenerator.kt:481 */
   29     42   
                        match value {
   30     43   
                            Some(value) => {
   31     44   
                                map.insert(key, value);
   32     45   
                            }
   33     46   
                            None => {
   34     47   
                                return Err(
   35     48   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36     49   
                                        "dense map cannot contain null values",
   37     50   
                                    ),
   38     51   
                                )
   39     52   
                            }
   40     53   
                        }
          54  +
                        /* JsonParserGenerator.kt:686 */
   41     55   
                    }
          56  +
                    /* JsonParserGenerator.kt:695 */
   42     57   
                    other => {
   43     58   
                        return Err(
   44     59   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   45     60   
                                format!("expected object key or end object, found: {:?}", other),
   46     61   
                            ),
   47     62   
                        )
   48         -
                    }
          63  +
                    } /* JsonParserGenerator.kt:685 */
   49     64   
                }
          65  +
                /* JsonParserGenerator.kt:684 */
   50     66   
            }
          67  +
            /* JsonParserGenerator.kt:504 */
   51     68   
            Ok(Some(map))
          69  +
            /* JsonParserGenerator.kt:713 */
   52     70   
        }
   53         -
        _ => Err(
   54         -
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   55         -
                "expected start object or null",
   56         -
            ),
   57         -
        ),
          71  +
        /* JsonParserGenerator.kt:722 */
          72  +
        _ => {
          73  +
            /* JsonParserGenerator.kt:723 */
          74  +
            Err(
          75  +
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          76  +
                    "expected start object or null",
          77  +
                ),
          78  +
            )
          79  +
            /* JsonParserGenerator.kt:722 */
          80  +
        } /* JsonParserGenerator.kt:712 */
   58     81   
    }
          82  +
    /* JsonParserGenerator.kt:460 */
   59     83   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_required_header_collection_operation.rs

@@ -1,1 +164,229 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_required_header_collection_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RequiredHeaderCollectionOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::required_header_collection_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   23     31   
        if let Some(value) = crate::protocol_serde::shape_required_header_collection_operation_input::de_required_header_list_header(&headers)? {
   24     32   
                                input = input.set_required_header_list(value)
   25     33   
                            }
          34  +
        /* ServerHttpBoundProtocolGenerator.kt:794 */
   26     35   
        if let Some(value) = crate::protocol_serde::shape_required_header_collection_operation_input::de_required_header_set_header(&headers)? {
   27     36   
                                input = input.set_required_header_set(value)
   28     37   
                            }
          38  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   29     39   
        input.build()?
          40  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   30     41   
    })
          42  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   31     43   
}
   32     44   
          45  +
/* RustType.kt:516 */
   33     46   
#[allow(clippy::unnecessary_wraps)]
          47  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   34     48   
pub fn ser_required_header_collection_operation_http_response(
   35     49   
    #[allow(unused_variables)] output: crate::output::RequiredHeaderCollectionOperationOutput,
   36     50   
) -> std::result::Result<
   37     51   
    ::aws_smithy_http_server::response::Response,
   38     52   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   39     53   
> {
          54  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   40     55   
    Ok({
          56  +
        /* RustType.kt:516 */
   41     57   
        #[allow(unused_mut)]
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   42     59   
        let mut builder = ::http::Response::builder();
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:629 */
   43     61   
        builder = crate::protocol_serde::shape_required_header_collection_operation::ser_required_header_collection_operation_headers(&output, builder)?;
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     63   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     64   
            builder,
   46     65   
            ::http::header::CONTENT_TYPE,
   47     66   
            "application/json",
   48     67   
        );
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     69   
        let http_status: u16 = 200;
   50     70   
        builder = builder.status(http_status);
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     72   
        let payload =
   52         -
            crate::protocol_serde::shape_required_header_collection_operation_output::ser_required_header_collection_operation_output_output_output(&output)?
   53         -
        ;
          73  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_required_header_collection_operation_output::ser_required_header_collection_operation_output_output_output(&output)?
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   54     76   
        let content_length = payload.len();
   55     77   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     78   
            builder,
   57     79   
            ::http::header::CONTENT_LENGTH,
   58     80   
            content_length,
   59     81   
        );
          82  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   60     83   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   61     85   
        builder.body(body)?
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   62     87   
    })
          88  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   63     89   
}
   64     90   
          91  +
/* RustType.kt:516 */
   65     92   
#[allow(clippy::unnecessary_wraps)]
          93  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   66     94   
pub fn ser_required_header_collection_operation_http_error(
   67     95   
    error: &crate::error::RequiredHeaderCollectionOperationError,
   68     96   
) -> std::result::Result<
   69     97   
    ::aws_smithy_http_server::response::Response,
   70     98   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     99   
> {
         100  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   72    101   
    Ok({
         102  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   73    103   
        match error {
         104  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   74    105   
            crate::error::RequiredHeaderCollectionOperationError::ValidationException(output) => {
         106  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   75    107   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         108  +
                /* RustType.kt:516 */
   76    109   
                #[allow(unused_mut)]
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   77    111   
                let mut builder = ::http::Response::builder();
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    113   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    114   
                    builder,
   80    115   
                    ::http::header::CONTENT_TYPE,
   81    116   
                    "application/json",
   82    117   
                );
         118  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   83    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    120   
                    builder,
   85    121   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86    122   
                    "ValidationException",
   87    123   
                );
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   88    125   
                let content_length = payload.len();
   89    126   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   90    127   
                    builder,
   91    128   
                    ::http::header::CONTENT_LENGTH,
   92    129   
                    content_length,
   93    130   
                );
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   94    132   
                builder
   95    133   
                    .status(400)
   96    134   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   97    136   
            }
         137  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    138   
            crate::error::RequiredHeaderCollectionOperationError::InternalServerError(output) => {
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   99    140   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         141  +
                /* RustType.kt:516 */
  100    142   
                #[allow(unused_mut)]
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  101    144   
                let mut builder = ::http::Response::builder();
         145  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  102    146   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    147   
                    builder,
  104    148   
                    ::http::header::CONTENT_TYPE,
  105    149   
                    "application/json",
  106    150   
                );
         151  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  107    152   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  108    153   
                    builder,
  109    154   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  110    155   
                    "InternalServerError",
  111    156   
                );
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  112    158   
                let content_length = payload.len();
  113    159   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  114    160   
                    builder,
  115    161   
                    ::http::header::CONTENT_LENGTH,
  116    162   
                    content_length,
  117    163   
                );
         164  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  118    165   
                builder
  119    166   
                    .status(500)
  120    167   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  121         -
            }
         168  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         169  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  122    170   
        }
         171  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  123    172   
    })
         173  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  124    174   
}
  125    175   
         176  +
/* HttpBindingGenerator.kt:542 */
  126    177   
pub fn ser_required_header_collection_operation_headers(
  127    178   
    input: &crate::output::RequiredHeaderCollectionOperationOutput,
  128    179   
    mut builder: ::http::response::Builder,
  129    180   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  130    181   
{
         182  +
    /* HttpBindingGenerator.kt:646 */
  131    183   
    for inner_1 in &input.required_header_list {
         184  +
        /* HttpBindingGenerator.kt:704 */
  132    185   
        let formatted_2 = ::aws_smithy_http::header::quote_header_value(inner_1.as_str());
         186  +
        /* HttpBindingGenerator.kt:705 */
  133    187   
        if !formatted_2.is_empty() {
         188  +
            /* HttpBindingGenerator.kt:706 */
  134    189   
            let header_value = formatted_2;
  135    190   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  136    191   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  137    192   
                    "required_header_list",
  138    193   
                    format!(
  139    194   
                        "`{}` cannot be used as a header value: {}",
  140    195   
                        &header_value, err
  141    196   
                    ),
  142    197   
                )
  143    198   
            })?;
  144    199   
            builder = builder.header("X-Required-List", header_value);
         200  +
            /* HttpBindingGenerator.kt:705 */
  145    201   
        }
         202  +
        /* HttpBindingGenerator.kt:646 */
  146    203   
    }
         204  +
    /* HttpBindingGenerator.kt:646 */
  147    205   
    for inner_3 in &input.required_header_set {
         206  +
        /* HttpBindingGenerator.kt:704 */
  148    207   
        let formatted_4 = ::aws_smithy_http::header::quote_header_value(inner_3.as_str());
         208  +
        /* HttpBindingGenerator.kt:705 */
  149    209   
        if !formatted_4.is_empty() {
         210  +
            /* HttpBindingGenerator.kt:706 */
  150    211   
            let header_value = formatted_4;
  151    212   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  152    213   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  153    214   
                    "required_header_set",
  154    215   
                    format!(
  155    216   
                        "`{}` cannot be used as a header value: {}",
  156    217   
                        &header_value, err
  157    218   
                    ),
  158    219   
                )
  159    220   
            })?;
  160    221   
            builder = builder.header("X-Required-Set", header_value);
         222  +
            /* HttpBindingGenerator.kt:705 */
  161    223   
        }
         224  +
        /* HttpBindingGenerator.kt:646 */
  162    225   
    }
         226  +
    /* HttpBindingGenerator.kt:555 */
  163    227   
    Ok(builder)
         228  +
    /* HttpBindingGenerator.kt:542 */
  164    229   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_required_header_collection_operation_input.rs

@@ -1,1 +26,36 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* HttpBindingGenerator.kt:153 */
    2      3   
pub(crate) fn de_required_header_list_header(
    3      4   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      5   
) -> ::std::result::Result<
    5      6   
    ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    6      7   
    ::aws_smithy_http::header::ParseError,
    7      8   
> {
           9  +
    /* HttpBindingGenerator.kt:160 */
    8     10   
    let headers = header_map.get_all("X-Required-List");
          11  +
    /* HttpBindingGenerator.kt:409 */
    9     12   
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          13  +
    /* HttpBindingGenerator.kt:430 */
   10     14   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
          15  +
    /* HttpBindingGenerator.kt:153 */
   11     16   
}
   12     17   
          18  +
/* HttpBindingGenerator.kt:153 */
   13     19   
pub(crate) fn de_required_header_set_header(
   14     20   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   15     21   
) -> ::std::result::Result<
   16     22   
    ::std::option::Option<crate::unconstrained::header_set_unconstrained::HeaderSetUnconstrained>,
   17     23   
    ::aws_smithy_http::header::ParseError,
   18     24   
> {
          25  +
    /* HttpBindingGenerator.kt:160 */
   19     26   
    let headers = header_map.get_all("X-Required-Set");
          27  +
    /* HttpBindingGenerator.kt:409 */
   20     28   
    let var_2: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          29  +
    /* HttpBindingGenerator.kt:456 */
   21     30   
    Ok(if !var_2.is_empty() {
   22     31   
        Some(crate::unconstrained::header_set_unconstrained::HeaderSetUnconstrained(var_2))
   23     32   
    } else {
   24     33   
        None
   25     34   
    })
          35  +
    /* HttpBindingGenerator.kt:153 */
   26     36   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_required_header_collection_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_required_header_collection_operation_output_output_output(
    3      4   
    value: &crate::output::RequiredHeaderCollectionOperationOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_required_header_collection_operation_output::ser_required_header_collection_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_required_header_collection_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::RequiredHeaderCollectionOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_required_inner_shape_operation.rs

@@ -1,1 +170,239 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_required_inner_shape_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::RequiredInnerShapeOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::required_inner_shape_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   23     31   
        let bytes = ::hyper::body::to_bytes(body).await?;
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   24     33   
        if !bytes.is_empty() {
          34  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   25     35   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   26     36   
                &headers,
   27     37   
                Some("application/json"),
   28     38   
            )?;
   29     39   
            input = crate::protocol_serde::shape_required_inner_shape_operation::de_required_inner_shape_operation(bytes.as_ref(), input)?;
          40  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   30     41   
        }
          42  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   31     43   
        input.build()?
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   32     45   
    })
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   33     47   
}
   34     48   
          49  +
/* RustType.kt:516 */
   35     50   
#[allow(clippy::unnecessary_wraps)]
          51  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   36     52   
pub fn ser_required_inner_shape_operation_http_response(
   37     53   
    #[allow(unused_variables)] output: crate::output::RequiredInnerShapeOperationOutput,
   38     54   
) -> std::result::Result<
   39     55   
    ::aws_smithy_http_server::response::Response,
   40     56   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     57   
> {
          58  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   42     59   
    Ok({
          60  +
        /* RustType.kt:516 */
   43     61   
        #[allow(unused_mut)]
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   44     63   
        let mut builder = ::http::Response::builder();
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   45     65   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     66   
            builder,
   47     67   
            ::http::header::CONTENT_TYPE,
   48     68   
            "application/json",
   49     69   
        );
          70  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   50     71   
        let http_status: u16 = 200;
   51     72   
        builder = builder.status(http_status);
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   52     74   
        let payload =
   53         -
            crate::protocol_serde::shape_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output_output(&output)?
   54         -
        ;
          75  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output_output(&output)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   55     78   
        let content_length = payload.len();
   56     79   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     80   
            builder,
   58     81   
            ::http::header::CONTENT_LENGTH,
   59     82   
            content_length,
   60     83   
        );
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   61     85   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   62     87   
        builder.body(body)?
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   63     89   
    })
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   64     91   
}
   65     92   
          93  +
/* RustType.kt:516 */
   66     94   
#[allow(clippy::unnecessary_wraps)]
          95  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   67     96   
pub fn ser_required_inner_shape_operation_http_error(
   68     97   
    error: &crate::error::RequiredInnerShapeOperationError,
   69     98   
) -> std::result::Result<
   70     99   
    ::aws_smithy_http_server::response::Response,
   71    100   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   72    101   
> {
         102  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   73    103   
    Ok({
         104  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   74    105   
        match error {
         106  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   75    107   
            crate::error::RequiredInnerShapeOperationError::ValidationException(output) => {
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   76    109   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         110  +
                /* RustType.kt:516 */
   77    111   
                #[allow(unused_mut)]
         112  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   78    113   
                let mut builder = ::http::Response::builder();
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   79    115   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   80    116   
                    builder,
   81    117   
                    ::http::header::CONTENT_TYPE,
   82    118   
                    "application/json",
   83    119   
                );
         120  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   84    121   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    122   
                    builder,
   86    123   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   87    124   
                    "ValidationException",
   88    125   
                );
         126  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   89    127   
                let content_length = payload.len();
   90    128   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                    builder,
   92    130   
                    ::http::header::CONTENT_LENGTH,
   93    131   
                    content_length,
   94    132   
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   95    134   
                builder
   96    135   
                    .status(400)
   97    136   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         137  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   98    138   
            }
         139  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   99    140   
            crate::error::RequiredInnerShapeOperationError::InternalServerError(output) => {
         141  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  100    142   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         143  +
                /* RustType.kt:516 */
  101    144   
                #[allow(unused_mut)]
         145  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  102    146   
                let mut builder = ::http::Response::builder();
         147  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  103    148   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  104    149   
                    builder,
  105    150   
                    ::http::header::CONTENT_TYPE,
  106    151   
                    "application/json",
  107    152   
                );
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  108    154   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    155   
                    builder,
  110    156   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    157   
                    "InternalServerError",
  112    158   
                );
         159  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  113    160   
                let content_length = payload.len();
  114    161   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  115    162   
                    builder,
  116    163   
                    ::http::header::CONTENT_LENGTH,
  117    164   
                    content_length,
  118    165   
                );
         166  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  119    167   
                builder
  120    168   
                    .status(500)
  121    169   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  122         -
            }
         170  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         171  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  123    172   
        }
         173  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  124    174   
    })
         175  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  125    176   
}
  126    177   
         178  +
/* JsonParserGenerator.kt:148 */
  127    179   
pub(crate) fn de_required_inner_shape_operation(
  128    180   
    value: &[u8],
  129    181   
    mut builder: crate::input::required_inner_shape_operation_input_internal::Builder,
  130    182   
) -> ::std::result::Result<
  131    183   
    crate::input::required_inner_shape_operation_input_internal::Builder,
  132    184   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  133    185   
> {
         186  +
    /* JsonParserGenerator.kt:153 */
  134    187   
    let mut tokens_owned =
  135    188   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  136    189   
            .peekable();
  137    190   
    let tokens = &mut tokens_owned;
  138    191   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         192  +
    /* JsonParserGenerator.kt:684 */
  139    193   
    loop {
         194  +
        /* JsonParserGenerator.kt:685 */
  140    195   
        match tokens.next().transpose()? {
         196  +
            /* JsonParserGenerator.kt:686 */
  141    197   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  142    198   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         199  +
                /* JsonParserGenerator.kt:260 */
  143    200   
                match key.to_unescaped()?.as_ref() {
         201  +
                    /* JsonParserGenerator.kt:262 */
  144    202   
                    "inner" => {
         203  +
                        /* JsonParserGenerator.kt:272 */
  145    204   
                        builder = builder.set_inner(
  146         -
                            crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?,
  147         -
                        );
         205  +
                            /* JsonParserGenerator.kt:544 */crate::protocol_serde::shape_inner_shape::de_inner_shape(tokens)?
         206  +
                        /* JsonParserGenerator.kt:272 */);
         207  +
                        /* JsonParserGenerator.kt:262 */
  148    208   
                    }
  149         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         209  +
                    /* JsonParserGenerator.kt:290 */
         210  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  150    211   
                }
         212  +
                /* JsonParserGenerator.kt:686 */
  151    213   
            }
         214  +
            /* JsonParserGenerator.kt:695 */
  152    215   
            other => {
  153    216   
                return Err(
  154    217   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  155    218   
                        "expected object key or end object, found: {:?}",
  156    219   
                        other
  157    220   
                    )),
  158    221   
                )
  159         -
            }
         222  +
            } /* JsonParserGenerator.kt:685 */
  160    223   
        }
         224  +
        /* JsonParserGenerator.kt:684 */
  161    225   
    }
         226  +
    /* JsonParserGenerator.kt:250 */
  162    227   
    if tokens.next().is_some() {
         228  +
        /* JsonParserGenerator.kt:251 */
  163    229   
        return Err(
  164    230   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  165    231   
                "found more JSON tokens after completing parsing",
  166    232   
            ),
  167    233   
        );
         234  +
        /* JsonParserGenerator.kt:250 */
  168    235   
    }
         236  +
    /* JsonParserGenerator.kt:163 */
  169    237   
    Ok(builder)
         238  +
    /* JsonParserGenerator.kt:148 */
  170    239   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_required_inner_shape_operation_output.rs

@@ -1,1 +23,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_required_inner_shape_operation_output_output_output(
    3      4   
    value: &crate::output::RequiredInnerShapeOperationOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_required_inner_shape_operation_output::ser_required_inner_shape_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_required_inner_shape_operation_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::RequiredInnerShapeOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.inner {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("inner").start_object();
          28  +
        /* JsonSerializerGenerator.kt:375 */
   19     29   
        crate::protocol_serde::shape_inner_shape::ser_inner_shape(&mut object_2, var_1)?;
          30  +
        /* JsonSerializerGenerator.kt:515 */
   20     31   
        object_2.finish();
          32  +
        /* JsonSerializerGenerator.kt:382 */
   21     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:372 */
   22     35   
    Ok(())
          36  +
    /* JsonSerializerGenerator.kt:358 */
   23     37   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_response_code_default_operation.rs

@@ -1,1 +93,131 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_response_code_default_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResponseCodeDefaultOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::response_code_default_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     31   
        input.build()
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     33   
    })
          34  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     35   
}
   26     36   
          37  +
/* RustType.kt:516 */
   27     38   
#[allow(clippy::unnecessary_wraps)]
          39  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     40   
pub fn ser_response_code_default_operation_http_response(
   29     41   
    #[allow(unused_variables)] output: crate::output::ResponseCodeDefaultOperationOutput,
   30     42   
) -> std::result::Result<
   31     43   
    ::aws_smithy_http_server::response::Response,
   32     44   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     45   
> {
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     47   
    Ok({
          48  +
        /* RustType.kt:516 */
   35     49   
        #[allow(unused_mut)]
          50  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     51   
        let mut builder = ::http::Response::builder();
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     54   
            builder,
   39     55   
            ::http::header::CONTENT_TYPE,
   40     56   
            "application/json",
   41     57   
        );
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     59   
        let http_status: u16 = 200;
   43     60   
        builder = builder.status(http_status);
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     62   
        let payload =
   45         -
            crate::protocol_serde::shape_response_code_default_operation_output::ser_response_code_default_operation_output_output_output(&output)?
   46         -
        ;
          63  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_response_code_default_operation_output::ser_response_code_default_operation_output_output_output(&output)?
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     66   
        let content_length = payload.len();
   48     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     68   
            builder,
   50     69   
            ::http::header::CONTENT_LENGTH,
   51     70   
            content_length,
   52     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     73   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     75   
        builder.body(body)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     77   
    })
          78  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     79   
}
   57     80   
          81  +
/* RustType.kt:516 */
   58     82   
#[allow(clippy::unnecessary_wraps)]
          83  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   59     84   
pub fn ser_response_code_default_operation_http_error(
   60     85   
    error: &crate::error::ResponseCodeDefaultOperationError,
   61     86   
) -> std::result::Result<
   62     87   
    ::aws_smithy_http_server::response::Response,
   63     88   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     89   
> {
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   65     91   
    Ok({
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   66     93   
        match error {
          94  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   67     95   
            crate::error::ResponseCodeDefaultOperationError::InternalServerError(output) => {
          96  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   68     97   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          98  +
                /* RustType.kt:516 */
   69     99   
                #[allow(unused_mut)]
         100  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   70    101   
                let mut builder = ::http::Response::builder();
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   71    103   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72    104   
                    builder,
   73    105   
                    ::http::header::CONTENT_TYPE,
   74    106   
                    "application/json",
   75    107   
                );
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    109   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    110   
                    builder,
   78    111   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   79    112   
                    "InternalServerError",
   80    113   
                );
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    115   
                let content_length = payload.len();
   82    116   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    117   
                    builder,
   84    118   
                    ::http::header::CONTENT_LENGTH,
   85    119   
                    content_length,
   86    120   
                );
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    122   
                builder
   88    123   
                    .status(500)
   89    124   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90         -
            }
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         126  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   91    127   
        }
         128  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    129   
    })
         130  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    131   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_response_code_default_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_response_code_default_operation_output_output_output(
    3      4   
    value: &crate::output::ResponseCodeDefaultOperationOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_response_code_default_operation_output::ser_response_code_default_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_response_code_default_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ResponseCodeDefaultOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_response_code_http_fallback_operation.rs

@@ -1,1 +93,131 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_response_code_http_fallback_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResponseCodeHttpFallbackOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::response_code_http_fallback_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     31   
        input.build()
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     33   
    })
          34  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     35   
}
   26     36   
          37  +
/* RustType.kt:516 */
   27     38   
#[allow(clippy::unnecessary_wraps)]
          39  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     40   
pub fn ser_response_code_http_fallback_operation_http_response(
   29     41   
    #[allow(unused_variables)] output: crate::output::ResponseCodeHttpFallbackOperationOutput,
   30     42   
) -> std::result::Result<
   31     43   
    ::aws_smithy_http_server::response::Response,
   32     44   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     45   
> {
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     47   
    Ok({
          48  +
        /* RustType.kt:516 */
   35     49   
        #[allow(unused_mut)]
          50  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     51   
        let mut builder = ::http::Response::builder();
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     54   
            builder,
   39     55   
            ::http::header::CONTENT_TYPE,
   40     56   
            "application/json",
   41     57   
        );
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     59   
        let http_status: u16 = 201;
   43     60   
        builder = builder.status(http_status);
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     62   
        let payload =
   45         -
            crate::protocol_serde::shape_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output_output(&output)?
   46         -
        ;
          63  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output_output(&output)?
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     66   
        let content_length = payload.len();
   48     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     68   
            builder,
   50     69   
            ::http::header::CONTENT_LENGTH,
   51     70   
            content_length,
   52     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     73   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     75   
        builder.body(body)?
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     77   
    })
          78  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     79   
}
   57     80   
          81  +
/* RustType.kt:516 */
   58     82   
#[allow(clippy::unnecessary_wraps)]
          83  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   59     84   
pub fn ser_response_code_http_fallback_operation_http_error(
   60     85   
    error: &crate::error::ResponseCodeHttpFallbackOperationError,
   61     86   
) -> std::result::Result<
   62     87   
    ::aws_smithy_http_server::response::Response,
   63     88   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     89   
> {
          90  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   65     91   
    Ok({
          92  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   66     93   
        match error {
          94  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   67     95   
            crate::error::ResponseCodeHttpFallbackOperationError::InternalServerError(output) => {
          96  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   68     97   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
          98  +
                /* RustType.kt:516 */
   69     99   
                #[allow(unused_mut)]
         100  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   70    101   
                let mut builder = ::http::Response::builder();
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   71    103   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   72    104   
                    builder,
   73    105   
                    ::http::header::CONTENT_TYPE,
   74    106   
                    "application/json",
   75    107   
                );
         108  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   76    109   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77    110   
                    builder,
   78    111   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   79    112   
                    "InternalServerError",
   80    113   
                );
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   81    115   
                let content_length = payload.len();
   82    116   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83    117   
                    builder,
   84    118   
                    ::http::header::CONTENT_LENGTH,
   85    119   
                    content_length,
   86    120   
                );
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   87    122   
                builder
   88    123   
                    .status(500)
   89    124   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90         -
            }
         125  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         126  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   91    127   
        }
         128  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   92    129   
    })
         130  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   93    131   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_response_code_http_fallback_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_response_code_http_fallback_operation_output_output_output(
    3      4   
    value: &crate::output::ResponseCodeHttpFallbackOperationOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_response_code_http_fallback_operation_output::ser_response_code_http_fallback_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_response_code_http_fallback_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ResponseCodeHttpFallbackOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_response_code_required_operation.rs

@@ -1,1 +94,134 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_response_code_required_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResponseCodeRequiredOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::response_code_required_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     31   
        input.build()
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     33   
    })
          34  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     35   
}
   26     36   
          37  +
/* RustType.kt:516 */
   27     38   
#[allow(clippy::unnecessary_wraps)]
          39  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     40   
pub fn ser_response_code_required_operation_http_response(
   29     41   
    #[allow(unused_variables)] output: crate::output::ResponseCodeRequiredOperationOutput,
   30     42   
) -> std::result::Result<
   31     43   
    ::aws_smithy_http_server::response::Response,
   32     44   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     45   
> {
          46  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     47   
    Ok({
          48  +
        /* RustType.kt:516 */
   35     49   
        #[allow(unused_mut)]
          50  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     51   
        let mut builder = ::http::Response::builder();
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     53   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     54   
            builder,
   39     55   
            ::http::header::CONTENT_TYPE,
   40     56   
            "application/json",
   41     57   
        );
   42         -
        let status = output.response_code;
          58  +
        /* ServerHttpBoundProtocolGenerator.kt:701 */
          59  +
        let status = output.response_code
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:701 */;
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:706 */
   43     62   
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   44     63   
        builder = builder.status(http_status);
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   45     65   
        let payload =
   46         -
            crate::protocol_serde::shape_response_code_required_operation_output::ser_response_code_required_operation_output_output_output(&output)?
   47         -
        ;
          66  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_response_code_required_operation_output::ser_response_code_required_operation_output_output_output(&output)?
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          68  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   48     69   
        let content_length = payload.len();
   49     70   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     71   
            builder,
   51     72   
            ::http::header::CONTENT_LENGTH,
   52     73   
            content_length,
   53     74   
        );
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   54     76   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   55     78   
        builder.body(body)?
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   56     80   
    })
          81  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   57     82   
}
   58     83   
          84  +
/* RustType.kt:516 */
   59     85   
#[allow(clippy::unnecessary_wraps)]
          86  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   60     87   
pub fn ser_response_code_required_operation_http_error(
   61     88   
    error: &crate::error::ResponseCodeRequiredOperationError,
   62     89   
) -> std::result::Result<
   63     90   
    ::aws_smithy_http_server::response::Response,
   64     91   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     92   
> {
          93  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   66     94   
    Ok({
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   67     96   
        match error {
          97  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   68     98   
            crate::error::ResponseCodeRequiredOperationError::InternalServerError(output) => {
          99  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   69    100   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         101  +
                /* RustType.kt:516 */
   70    102   
                #[allow(unused_mut)]
         103  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   71    104   
                let mut builder = ::http::Response::builder();
         105  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   72    106   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   73    107   
                    builder,
   74    108   
                    ::http::header::CONTENT_TYPE,
   75    109   
                    "application/json",
   76    110   
                );
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   77    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78    113   
                    builder,
   79    114   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80    115   
                    "InternalServerError",
   81    116   
                );
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   82    118   
                let content_length = payload.len();
   83    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    120   
                    builder,
   85    121   
                    ::http::header::CONTENT_LENGTH,
   86    122   
                    content_length,
   87    123   
                );
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   88    125   
                builder
   89    126   
                    .status(500)
   90    127   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   91         -
            }
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         129  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
   92    130   
        }
         131  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
   93    132   
    })
         133  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
   94    134   
}

tmp-codegen-diff/codegen-server-test-python/misc/rust-server-codegen-python/src/protocol_serde/shape_response_code_required_operation_output.rs

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_response_code_required_operation_output_output_output(
    3      4   
    value: &crate::output::ResponseCodeRequiredOperationOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_response_code_required_operation_output::ser_response_code_required_operation_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_response_code_required_operation_output_output(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::output::ResponseCodeRequiredOperationOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}