Server Test Python

Server Test Python

rev. 3c756f73b1f83a0eed4275d9d1e22df0b10b66fb

Files changed:

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_null_and_empty_headers_server.rs

@@ -1,1 +167,168 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_null_and_empty_headers_server_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::NullAndEmptyHeadersServerInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::null_and_empty_headers_server_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) =
   24     24   
            crate::protocol_serde::shape_null_and_empty_headers_server_input::de_a_header(&headers)?
   25     25   
        {
   26     26   
            input = input.set_a(Some(value))
   27     27   
        }
   28     28   
        if let Some(value) =
   29     29   
            crate::protocol_serde::shape_null_and_empty_headers_server_input::de_b_header(&headers)?
   30     30   
        {
   31     31   
            input = input.set_b(Some(value))
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_null_and_empty_headers_server_input::de_c_header(&headers)?
   35     35   
        {
   36     36   
            input = input.set_c(Some(value))
   37     37   
        }
   38     38   
        input.build()
   39     39   
    })
   40     40   
}
   41     41   
   42     42   
#[allow(clippy::unnecessary_wraps)]
   43     43   
pub fn ser_null_and_empty_headers_server_http_response(
   44     44   
    #[allow(unused_variables)] output: crate::output::NullAndEmptyHeadersServerOutput,
   45     45   
) -> std::result::Result<
   46         -
    ::aws_smithy_http_server::response::Response,
   47         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          46  +
    ::aws_smithy_legacy_http_server::response::Response,
          47  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   48     48   
> {
   49     49   
    Ok({
   50     50   
        #[allow(unused_mut)]
   51     51   
        let mut builder = ::http::Response::builder();
   52     52   
        builder = crate::protocol_serde::shape_null_and_empty_headers_server::ser_null_and_empty_headers_server_headers(&output, builder)?;
   53         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          53  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   54     54   
            builder,
   55     55   
            ::http::header::CONTENT_TYPE,
   56     56   
            "application/json",
   57     57   
        );
   58     58   
        let http_status: u16 = 200;
   59     59   
        builder = builder.status(http_status);
   60     60   
        let payload =
   61     61   
            crate::protocol_serde::shape_null_and_empty_headers_server_output::ser_null_and_empty_headers_server_output_output_output(&output)?
   62     62   
        ;
   63     63   
        let content_length = payload.len();
   64         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          64  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   65     65   
            builder,
   66     66   
            ::http::header::CONTENT_LENGTH,
   67     67   
            content_length,
   68     68   
        );
   69         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          69  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   70     70   
        builder.body(body)?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_null_and_empty_headers_server_http_error(
   76     76   
    error: &crate::error::NullAndEmptyHeadersServerError,
   77     77   
) -> std::result::Result<
   78         -
    ::aws_smithy_http_server::response::Response,
   79         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          78  +
    ::aws_smithy_legacy_http_server::response::Response,
          79  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   82     82   
        match error {
   83     83   
            crate::error::NullAndEmptyHeadersServerError::InternalServerError(output) => {
   84     84   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   85     85   
                #[allow(unused_mut)]
   86     86   
                let mut builder = ::http::Response::builder();
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::CONTENT_TYPE,
   90     90   
                    "application/json",
   91     91   
                );
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   95     95   
                    "InternalServerError",
   96     96   
                );
   97     97   
                let content_length = payload.len();
   98         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          98  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   99     99   
                    builder,
  100    100   
                    ::http::header::CONTENT_LENGTH,
  101    101   
                    content_length,
  102    102   
                );
  103    103   
                builder
  104    104   
                    .status(500)
  105         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         105  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  106    106   
            }
  107    107   
        }
  108    108   
    })
  109    109   
}
  110    110   
  111    111   
pub fn ser_null_and_empty_headers_server_headers(
  112    112   
    input: &crate::output::NullAndEmptyHeadersServerOutput,
  113    113   
    mut builder: ::http::response::Builder,
  114    114   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  115    115   
{
  116    116   
    if let ::std::option::Option::Some(inner_1) = &input.a {
  117    117   
        let formatted_2 = inner_1.as_str();
  118    118   
        if !formatted_2.is_empty() {
  119    119   
            let header_value = formatted_2;
  120    120   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  121    121   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  122    122   
                    "a",
  123    123   
                    format!(
  124    124   
                        "`{}` cannot be used as a header value: {}",
  125    125   
                        &header_value, err
  126    126   
                    ),
  127    127   
                )
  128    128   
            })?;
  129    129   
            builder = builder.header("X-A", header_value);
  130    130   
        }
  131    131   
    }
  132    132   
    if let ::std::option::Option::Some(inner_3) = &input.b {
  133    133   
        let formatted_4 = inner_3.as_str();
  134    134   
        if !formatted_4.is_empty() {
  135    135   
            let header_value = formatted_4;
  136    136   
            let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  137    137   
                ::aws_smithy_types::error::operation::BuildError::invalid_field(
  138    138   
                    "b",
  139    139   
                    format!(
  140    140   
                        "`{}` cannot be used as a header value: {}",
  141    141   
                        &header_value, err
  142    142   
                    ),
  143    143   
                )
  144    144   
            })?;
  145    145   
            builder = builder.header("X-B", header_value);
  146    146   
        }
  147    147   
    }
  148    148   
    if let ::std::option::Option::Some(inner_5) = &input.c {
  149    149   
        for inner_6 in inner_5 {
  150         -
            let formatted_7 = ::aws_smithy_http::header::quote_header_value(inner_6.as_str());
         150  +
            let formatted_7 =
         151  +
                ::aws_smithy_legacy_http::header::quote_header_value(inner_6.as_str());
  151    152   
            if !formatted_7.is_empty() {
  152    153   
                let header_value = formatted_7;
  153    154   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  154    155   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  155    156   
                        "c",
  156    157   
                        format!(
  157    158   
                            "`{}` cannot be used as a header value: {}",
  158    159   
                            &header_value, err
  159    160   
                        ),
  160    161   
                    )

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_null_and_empty_headers_server_input.rs

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_a_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("X-A");
    9         -
    ::aws_smithy_http::header::one_or_none(headers)
           9  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   10     10   
}
   11     11   
   12     12   
pub(crate) fn de_b_header(
   13     13   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   14     14   
) -> ::std::result::Result<
   15     15   
    ::std::option::Option<::std::string::String>,
   16         -
    ::aws_smithy_http::header::ParseError,
          16  +
    ::aws_smithy_legacy_http::header::ParseError,
   17     17   
> {
   18     18   
    let headers = header_map.get_all("X-B");
   19         -
    ::aws_smithy_http::header::one_or_none(headers)
          19  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   20     20   
}
   21     21   
   22     22   
pub(crate) fn de_c_header(
   23     23   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   24     24   
) -> ::std::result::Result<
   25     25   
    ::std::option::Option<::std::vec::Vec<::std::string::String>>,
   26         -
    ::aws_smithy_http::header::ParseError,
          26  +
    ::aws_smithy_legacy_http::header::ParseError,
   27     27   
> {
   28     28   
    let headers = header_map.get_all("X-C");
   29         -
    let var_1: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          29  +
    let var_1: Vec<::std::string::String> =
          30  +
        ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
   30     31   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
   31     32   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_omits_null_serializes_empty_string.rs

@@ -1,1 +109,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_omits_null_serializes_empty_string_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OmitsNullSerializesEmptyStringInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::omits_null_serializes_empty_string_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        let query_string = uri.query().unwrap_or("");
   24     24   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   25     25   
        let mut empty_string_seen = false;
   26     26   
        let mut null_value_seen = false;
   27     27   
        for (k, v) in pairs {
   28     28   
            if !empty_string_seen && k == "Empty" {
   29     29   
                input = input.set_empty_string(
   30     30   
                    crate::protocol_serde::shape_omits_null_serializes_empty_string_input::de_empty_string(&v)?
   31     31   
                );
   32     32   
                empty_string_seen = true;
   33     33   
            }
   34     34   
            if !null_value_seen && k == "Null" {
   35     35   
                input = input.set_null_value(
   36     36   
                    crate::protocol_serde::shape_omits_null_serializes_empty_string_input::de_null_value(&v)?
   37     37   
                );
   38     38   
                null_value_seen = true;
   39     39   
            }
   40     40   
        }
   41     41   
        input.build()
   42     42   
    })
   43     43   
}
   44     44   
   45     45   
#[allow(clippy::unnecessary_wraps)]
   46     46   
pub fn ser_omits_null_serializes_empty_string_http_response(
   47     47   
    #[allow(unused_variables)] output: crate::output::OmitsNullSerializesEmptyStringOutput,
   48     48   
) -> std::result::Result<
   49         -
    ::aws_smithy_http_server::response::Response,
   50         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          49  +
    ::aws_smithy_legacy_http_server::response::Response,
          50  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   51     51   
> {
   52     52   
    Ok({
   53     53   
        #[allow(unused_mut)]
   54     54   
        let mut builder = ::http::Response::builder();
   55         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57     57   
            ::http::header::CONTENT_TYPE,
   58     58   
            "application/json",
   59     59   
        );
   60     60   
        let http_status: u16 = 200;
   61     61   
        builder = builder.status(http_status);
   62     62   
        let payload = "";
   63     63   
        let content_length = payload.len();
   64         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          64  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   65     65   
            builder,
   66     66   
            ::http::header::CONTENT_LENGTH,
   67     67   
            content_length,
   68     68   
        );
   69         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          69  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   70     70   
        builder.body(body)?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_omits_null_serializes_empty_string_http_error(
   76     76   
    error: &crate::error::OmitsNullSerializesEmptyStringError,
   77     77   
) -> std::result::Result<
   78         -
    ::aws_smithy_http_server::response::Response,
   79         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          78  +
    ::aws_smithy_legacy_http_server::response::Response,
          79  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   82     82   
        match error {
   83     83   
            crate::error::OmitsNullSerializesEmptyStringError::InternalServerError(output) => {
   84     84   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   85     85   
                #[allow(unused_mut)]
   86     86   
                let mut builder = ::http::Response::builder();
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::CONTENT_TYPE,
   90     90   
                    "application/json",
   91     91   
                );
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   95     95   
                    "InternalServerError",
   96     96   
                );
   97     97   
                let content_length = payload.len();
   98         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          98  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   99     99   
                    builder,
  100    100   
                    ::http::header::CONTENT_LENGTH,
  101    101   
                    content_length,
  102    102   
                );
  103    103   
                builder
  104    104   
                    .status(500)
  105         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         105  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  106    106   
            }
  107    107   
        }
  108    108   
    })
  109    109   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_omits_null_serializes_empty_string_input.rs

@@ -1,1 +20,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_empty_string(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = value.to_owned();
    9      9   
    Ok(Some(value))
   10     10   
}
   11     11   
   12     12   
pub fn de_null_value(
   13     13   
    value: &str,
   14     14   
) -> std::result::Result<
   15     15   
    ::std::option::Option<::std::string::String>,
   16         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          16  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     17   
> {
   18     18   
    let value = value.to_owned();
   19     19   
    Ok(Some(value))
   20     20   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_omits_serializing_empty_lists.rs

@@ -1,1 +43,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_omits_serializing_empty_lists_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OmitsSerializingEmptyListsInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::omits_serializing_empty_lists_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        let query_string = uri.query().unwrap_or("");
@@ -63,63 +177,177 @@
   83     83   
            input = input.set_query_timestamp_list(Some(query_timestamp_list));
   84     84   
        }
   85     85   
        input.build()?
   86     86   
    })
   87     87   
}
   88     88   
   89     89   
#[allow(clippy::unnecessary_wraps)]
   90     90   
pub fn ser_omits_serializing_empty_lists_http_response(
   91     91   
    #[allow(unused_variables)] output: crate::output::OmitsSerializingEmptyListsOutput,
   92     92   
) -> std::result::Result<
   93         -
    ::aws_smithy_http_server::response::Response,
   94         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          93  +
    ::aws_smithy_legacy_http_server::response::Response,
          94  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   95     95   
> {
   96     96   
    Ok({
   97     97   
        #[allow(unused_mut)]
   98     98   
        let mut builder = ::http::Response::builder();
   99         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          99  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  100    100   
            builder,
  101    101   
            ::http::header::CONTENT_TYPE,
  102    102   
            "application/json",
  103    103   
        );
  104    104   
        let http_status: u16 = 200;
  105    105   
        builder = builder.status(http_status);
  106    106   
        let payload = "";
  107    107   
        let content_length = payload.len();
  108         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         108  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  109    109   
            builder,
  110    110   
            ::http::header::CONTENT_LENGTH,
  111    111   
            content_length,
  112    112   
        );
  113         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         113  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  114    114   
        builder.body(body)?
  115    115   
    })
  116    116   
}
  117    117   
  118    118   
#[allow(clippy::unnecessary_wraps)]
  119    119   
pub fn ser_omits_serializing_empty_lists_http_error(
  120    120   
    error: &crate::error::OmitsSerializingEmptyListsError,
  121    121   
) -> std::result::Result<
  122         -
    ::aws_smithy_http_server::response::Response,
  123         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         122  +
    ::aws_smithy_legacy_http_server::response::Response,
         123  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  124    124   
> {
  125    125   
    Ok({
  126    126   
        match error {
  127    127   
            crate::error::OmitsSerializingEmptyListsError::ValidationException(output) => {
  128    128   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  129    129   
                #[allow(unused_mut)]
  130    130   
                let mut builder = ::http::Response::builder();
  131         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         131  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  132    132   
                    builder,
  133    133   
                    ::http::header::CONTENT_TYPE,
  134    134   
                    "application/json",
  135    135   
                );
  136         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         136  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  137    137   
                    builder,
  138    138   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  139    139   
                    "ValidationException",
  140    140   
                );
  141    141   
                let content_length = payload.len();
  142         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         142  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  143    143   
                    builder,
  144    144   
                    ::http::header::CONTENT_LENGTH,
  145    145   
                    content_length,
  146    146   
                );
  147    147   
                builder
  148    148   
                    .status(400)
  149         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         149  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  150    150   
            }
  151    151   
            crate::error::OmitsSerializingEmptyListsError::InternalServerError(output) => {
  152    152   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  153    153   
                #[allow(unused_mut)]
  154    154   
                let mut builder = ::http::Response::builder();
  155         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         155  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  156    156   
                    builder,
  157    157   
                    ::http::header::CONTENT_TYPE,
  158    158   
                    "application/json",
  159    159   
                );
  160         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         160  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  161    161   
                    builder,
  162    162   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  163    163   
                    "InternalServerError",
  164    164   
                );
  165    165   
                let content_length = payload.len();
  166         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         166  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  167    167   
                    builder,
  168    168   
                    ::http::header::CONTENT_LENGTH,
  169    169   
                    content_length,
  170    170   
                );
  171    171   
                builder
  172    172   
                    .status(500)
  173         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         173  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  174    174   
            }
  175    175   
        }
  176    176   
    })
  177    177   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_operation_with_defaults.rs

@@ -1,1 +154,154 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_operation_with_defaults_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OperationWithDefaultsInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::operation_with_defaults_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input =
   29     29   
                crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults(
   30     30   
                    bytes.as_ref(),
   31     31   
                    input,
   32     32   
                )?;
   33     33   
        }
   34     34   
        input.build()?
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
#[allow(clippy::unnecessary_wraps)]
   39     39   
pub fn ser_operation_with_defaults_http_response(
   40     40   
    #[allow(unused_variables)] output: crate::output::OperationWithDefaultsOutput,
   41     41   
) -> std::result::Result<
   42         -
    ::aws_smithy_http_server::response::Response,
   43         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          42  +
    ::aws_smithy_legacy_http_server::response::Response,
          43  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   44     44   
> {
   45     45   
    Ok({
   46     46   
        #[allow(unused_mut)]
   47     47   
        let mut builder = ::http::Response::builder();
   48         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50     50   
            ::http::header::CONTENT_TYPE,
   51     51   
            "application/json",
   52     52   
        );
   53     53   
        let http_status: u16 = 200;
   54     54   
        builder = builder.status(http_status);
   55     55   
        let payload =
   56     56   
            crate::protocol_serde::shape_operation_with_defaults_output::ser_operation_with_defaults_output_output_output(&output)?
   57     57   
        ;
   58     58   
        let content_length = payload.len();
   59         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          59  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   60     60   
            builder,
   61     61   
            ::http::header::CONTENT_LENGTH,
   62     62   
            content_length,
   63     63   
        );
   64         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          64  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   65     65   
        builder.body(body)?
   66     66   
    })
   67     67   
}
   68     68   
   69     69   
#[allow(clippy::unnecessary_wraps)]
   70     70   
pub fn ser_operation_with_defaults_http_error(
   71     71   
    error: &crate::error::OperationWithDefaultsError,
   72     72   
) -> std::result::Result<
   73         -
    ::aws_smithy_http_server::response::Response,
   74         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          73  +
    ::aws_smithy_legacy_http_server::response::Response,
          74  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   75     75   
> {
   76     76   
    Ok({
   77     77   
        match error {
   78     78   
            crate::error::OperationWithDefaultsError::ValidationException(output) => {
   79     79   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   80     80   
                #[allow(unused_mut)]
   81     81   
                let mut builder = ::http::Response::builder();
   82         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84     84   
                    ::http::header::CONTENT_TYPE,
   85     85   
                    "application/json",
   86     86   
                );
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90     90   
                    "ValidationException",
   91     91   
                );
   92     92   
                let content_length = payload.len();
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95     95   
                    ::http::header::CONTENT_LENGTH,
   96     96   
                    content_length,
   97     97   
                );
   98     98   
                builder
   99     99   
                    .status(400)
  100         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         100  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  101    101   
            }
  102    102   
            crate::error::OperationWithDefaultsError::InternalServerError(output) => {
  103    103   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  104    104   
                #[allow(unused_mut)]
  105    105   
                let mut builder = ::http::Response::builder();
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         106  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    107   
                    builder,
  108    108   
                    ::http::header::CONTENT_TYPE,
  109    109   
                    "application/json",
  110    110   
                );
  111         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         111  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  112    112   
                    builder,
  113    113   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    114   
                    "InternalServerError",
  115    115   
                );
  116    116   
                let content_length = payload.len();
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119    119   
                    ::http::header::CONTENT_LENGTH,
  120    120   
                    content_length,
  121    121   
                );
  122    122   
                builder
  123    123   
                    .status(500)
  124         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         124  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  125    125   
            }
  126    126   
        }
  127    127   
    })
  128    128   
}
  129    129   
  130    130   
pub(crate) fn de_operation_with_defaults(
  131    131   
    value: &[u8],
  132    132   
    mut builder: crate::input::operation_with_defaults_input_internal::Builder,
  133    133   
) -> ::std::result::Result<
  134    134   
    crate::input::operation_with_defaults_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_operation_with_nested_structure.rs

@@ -1,1 +151,151 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_operation_with_nested_structure_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OperationWithNestedStructureInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::operation_with_nested_structure_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        let bytes = ::hyper::body::to_bytes(body).await?;
   24     24   
        if !bytes.is_empty() {
   25         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   26     26   
                &headers,
   27     27   
                Some("application/json"),
   28     28   
            )?;
   29     29   
            input = crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure(bytes.as_ref(), input)?;
   30     30   
        }
   31     31   
        input.build()?
   32     32   
    })
   33     33   
}
   34     34   
   35     35   
#[allow(clippy::unnecessary_wraps)]
   36     36   
pub fn ser_operation_with_nested_structure_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::OperationWithNestedStructureOutput,
   38     38   
) -> std::result::Result<
   39         -
    ::aws_smithy_http_server::response::Response,
   40         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          39  +
    ::aws_smithy_legacy_http_server::response::Response,
          40  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     41   
> {
   42     42   
    Ok({
   43     43   
        #[allow(unused_mut)]
   44     44   
        let mut builder = ::http::Response::builder();
   45         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          45  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47     47   
            ::http::header::CONTENT_TYPE,
   48     48   
            "application/json",
   49     49   
        );
   50     50   
        let http_status: u16 = 200;
   51     51   
        builder = builder.status(http_status);
   52     52   
        let payload =
   53     53   
            crate::protocol_serde::shape_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output_output(&output)?
   54     54   
        ;
   55     55   
        let content_length = payload.len();
   56         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          56  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   57     57   
            builder,
   58     58   
            ::http::header::CONTENT_LENGTH,
   59     59   
            content_length,
   60     60   
        );
   61         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          61  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   62     62   
        builder.body(body)?
   63     63   
    })
   64     64   
}
   65     65   
   66     66   
#[allow(clippy::unnecessary_wraps)]
   67     67   
pub fn ser_operation_with_nested_structure_http_error(
   68     68   
    error: &crate::error::OperationWithNestedStructureError,
   69     69   
) -> std::result::Result<
   70         -
    ::aws_smithy_http_server::response::Response,
   71         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          70  +
    ::aws_smithy_legacy_http_server::response::Response,
          71  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   72     72   
> {
   73     73   
    Ok({
   74     74   
        match error {
   75     75   
            crate::error::OperationWithNestedStructureError::ValidationException(output) => {
   76     76   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   77     77   
                #[allow(unused_mut)]
   78     78   
                let mut builder = ::http::Response::builder();
   79         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   80     80   
                    builder,
   81     81   
                    ::http::header::CONTENT_TYPE,
   82     82   
                    "application/json",
   83     83   
                );
   84         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          84  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   85     85   
                    builder,
   86     86   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   87     87   
                    "ValidationException",
   88     88   
                );
   89     89   
                let content_length = payload.len();
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          90  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   91     91   
                    builder,
   92     92   
                    ::http::header::CONTENT_LENGTH,
   93     93   
                    content_length,
   94     94   
                );
   95     95   
                builder
   96     96   
                    .status(400)
   97         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          97  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   98     98   
            }
   99     99   
            crate::error::OperationWithNestedStructureError::InternalServerError(output) => {
  100    100   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101    101   
                #[allow(unused_mut)]
  102    102   
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         103  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  104    104   
                    builder,
  105    105   
                    ::http::header::CONTENT_TYPE,
  106    106   
                    "application/json",
  107    107   
                );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         108  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  109    109   
                    builder,
  110    110   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    111   
                    "InternalServerError",
  112    112   
                );
  113    113   
                let content_length = payload.len();
  114         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         114  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  115    115   
                    builder,
  116    116   
                    ::http::header::CONTENT_LENGTH,
  117    117   
                    content_length,
  118    118   
                );
  119    119   
                builder
  120    120   
                    .status(500)
  121         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         121  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  122    122   
            }
  123    123   
        }
  124    124   
    })
  125    125   
}
  126    126   
  127    127   
pub(crate) fn de_operation_with_nested_structure(
  128    128   
    value: &[u8],
  129    129   
    mut builder: crate::input::operation_with_nested_structure_input_internal::Builder,
  130    130   
) -> ::std::result::Result<
  131    131   
    crate::input::operation_with_nested_structure_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_post_player_action.rs

@@ -1,1 +129,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_post_player_action_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::PostPlayerActionInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::post_player_action_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input = crate::protocol_serde::shape_post_player_action::de_post_player_action(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        input.build()
   34     34   
    })
   35     35   
}
   36     36   
   37     37   
#[allow(clippy::unnecessary_wraps)]
   38     38   
pub fn ser_post_player_action_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::PostPlayerActionOutput,
   40     40   
) -> std::result::Result<
   41         -
    ::aws_smithy_http_server::response::Response,
   42         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46     46   
        let mut builder = ::http::Response::builder();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49     49   
            ::http::header::CONTENT_TYPE,
   50     50   
            "application/json",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_post_player_action_output::ser_post_player_action_output_output_output(&output)?
   56     56   
        ;
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_post_player_action_http_error(
   70     70   
    error: &crate::error::PostPlayerActionError,
   71     71   
) -> std::result::Result<
   72         -
    ::aws_smithy_http_server::response::Response,
   73         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          72  +
    ::aws_smithy_legacy_http_server::response::Response,
          73  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     74   
> {
   75     75   
    Ok({
   76     76   
        match error {
   77     77   
            crate::error::PostPlayerActionError::InternalServerError(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80     80   
                let mut builder = ::http::Response::builder();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          81  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83     83   
                    ::http::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88     88   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "InternalServerError",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(500)
   99         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          99  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
        }
  102    102   
    })
  103    103   
}
  104    104   
  105    105   
pub(crate) fn de_post_player_action(
  106    106   
    value: &[u8],
  107    107   
    mut builder: crate::input::post_player_action_input_internal::Builder,
  108    108   
) -> ::std::result::Result<
  109    109   
    crate::input::post_player_action_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_post_union_with_json_name.rs

@@ -1,1 +126,126 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_post_union_with_json_name_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::PostUnionWithJsonNameInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::post_union_with_json_name_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input = crate::protocol_serde::shape_post_union_with_json_name::de_post_union_with_json_name(bytes.as_ref(), input)?;
   29     29   
        }
   30     30   
        input.build()
   31     31   
    })
   32     32   
}
   33     33   
   34     34   
#[allow(clippy::unnecessary_wraps)]
   35     35   
pub fn ser_post_union_with_json_name_http_response(
   36     36   
    #[allow(unused_variables)] output: crate::output::PostUnionWithJsonNameOutput,
   37     37   
) -> std::result::Result<
   38         -
    ::aws_smithy_http_server::response::Response,
   39         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          38  +
    ::aws_smithy_legacy_http_server::response::Response,
          39  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     40   
> {
   41     41   
    Ok({
   42     42   
        #[allow(unused_mut)]
   43     43   
        let mut builder = ::http::Response::builder();
   44         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          44  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   45     45   
            builder,
   46     46   
            ::http::header::CONTENT_TYPE,
   47     47   
            "application/json",
   48     48   
        );
   49     49   
        let http_status: u16 = 200;
   50     50   
        builder = builder.status(http_status);
   51     51   
        let payload =
   52     52   
            crate::protocol_serde::shape_post_union_with_json_name_output::ser_post_union_with_json_name_output_output_output(&output)?
   53     53   
        ;
   54     54   
        let content_length = payload.len();
   55         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57     57   
            ::http::header::CONTENT_LENGTH,
   58     58   
            content_length,
   59     59   
        );
   60         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          60  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   61     61   
        builder.body(body)?
   62     62   
    })
   63     63   
}
   64     64   
   65     65   
#[allow(clippy::unnecessary_wraps)]
   66     66   
pub fn ser_post_union_with_json_name_http_error(
   67     67   
    error: &crate::error::PostUnionWithJsonNameError,
   68     68   
) -> std::result::Result<
   69         -
    ::aws_smithy_http_server::response::Response,
   70         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          69  +
    ::aws_smithy_legacy_http_server::response::Response,
          70  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   71     71   
> {
   72     72   
    Ok({
   73     73   
        match error {
   74     74   
            crate::error::PostUnionWithJsonNameError::InternalServerError(output) => {
   75     75   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   76     76   
                #[allow(unused_mut)]
   77     77   
                let mut builder = ::http::Response::builder();
   78         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          78  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   79     79   
                    builder,
   80     80   
                    ::http::header::CONTENT_TYPE,
   81     81   
                    "application/json",
   82     82   
                );
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   86     86   
                    "InternalServerError",
   87     87   
                );
   88     88   
                let content_length = payload.len();
   89         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          89  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   90     90   
                    builder,
   91     91   
                    ::http::header::CONTENT_LENGTH,
   92     92   
                    content_length,
   93     93   
                );
   94     94   
                builder
   95     95   
                    .status(500)
   96         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          96  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   97     97   
            }
   98     98   
        }
   99     99   
    })
  100    100   
}
  101    101   
  102    102   
pub(crate) fn de_post_union_with_json_name(
  103    103   
    value: &[u8],
  104    104   
    mut builder: crate::input::post_union_with_json_name_input_internal::Builder,
  105    105   
) -> ::std::result::Result<
  106    106   
    crate::input::post_union_with_json_name_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +131,131 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_put_with_content_encoding_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::PutWithContentEncodingInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::put_with_content_encoding_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input = crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding(bytes.as_ref(), input)?;
   29     29   
        }
   30     30   
        if let Some(value) =
   31     31   
            crate::protocol_serde::shape_put_with_content_encoding_input::de_encoding_header(
   32     32   
                &headers,
   33     33   
            )?
   34     34   
        {
   35     35   
            input = input.set_encoding(Some(value))
   36     36   
        }
   37     37   
        input.build()
   38     38   
    })
   39     39   
}
   40     40   
   41     41   
#[allow(clippy::unnecessary_wraps)]
   42     42   
pub fn ser_put_with_content_encoding_http_response(
   43     43   
    #[allow(unused_variables)] output: crate::output::PutWithContentEncodingOutput,
   44     44   
) -> std::result::Result<
   45         -
    ::aws_smithy_http_server::response::Response,
   46         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          45  +
    ::aws_smithy_legacy_http_server::response::Response,
          46  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   47     47   
> {
   48     48   
    Ok({
   49     49   
        #[allow(unused_mut)]
   50     50   
        let mut builder = ::http::Response::builder();
   51         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   52     52   
            builder,
   53     53   
            ::http::header::CONTENT_TYPE,
   54     54   
            "application/json",
   55     55   
        );
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58     58   
        let payload = "";
   59     59   
        let content_length = payload.len();
   60         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          60  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   61     61   
            builder,
   62     62   
            ::http::header::CONTENT_LENGTH,
   63     63   
            content_length,
   64     64   
        );
   65         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          65  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   66     66   
        builder.body(body)?
   67     67   
    })
   68     68   
}
   69     69   
   70     70   
#[allow(clippy::unnecessary_wraps)]
   71     71   
pub fn ser_put_with_content_encoding_http_error(
   72     72   
    error: &crate::error::PutWithContentEncodingError,
   73     73   
) -> std::result::Result<
   74         -
    ::aws_smithy_http_server::response::Response,
   75         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          74  +
    ::aws_smithy_legacy_http_server::response::Response,
          75  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76     76   
> {
   77     77   
    Ok({
   78     78   
        match error {
   79     79   
            crate::error::PutWithContentEncodingError::InternalServerError(output) => {
   80     80   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   81     81   
                #[allow(unused_mut)]
   82     82   
                let mut builder = ::http::Response::builder();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::CONTENT_TYPE,
   86     86   
                    "application/json",
   87     87   
                );
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90     90   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   91     91   
                    "InternalServerError",
   92     92   
                );
   93     93   
                let content_length = payload.len();
   94         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          94  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   95     95   
                    builder,
   96     96   
                    ::http::header::CONTENT_LENGTH,
   97     97   
                    content_length,
   98     98   
                );
   99     99   
                builder
  100    100   
                    .status(500)
  101         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         101  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  102    102   
            }
  103    103   
        }
  104    104   
    })
  105    105   
}
  106    106   
  107    107   
pub(crate) fn de_put_with_content_encoding(
  108    108   
    value: &[u8],
  109    109   
    mut builder: crate::input::put_with_content_encoding_input_internal::Builder,
  110    110   
) -> ::std::result::Result<
  111    111   
    crate::input::put_with_content_encoding_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_put_with_content_encoding_input.rs

@@ -1,1 +10,10 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_encoding_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("Content-Encoding");
    9         -
    ::aws_smithy_http::header::one_or_none(headers)
           9  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   10     10   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_query_idempotency_token_auto_fill.rs

@@ -1,1 +104,104 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_query_idempotency_token_auto_fill_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::QueryIdempotencyTokenAutoFillInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::query_idempotency_token_auto_fill_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        let query_string = uri.query().unwrap_or("");
   24     24   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   25     25   
        let mut token_seen = false;
   26     26   
        for (k, v) in pairs {
   27     27   
            if !token_seen && k == "token" {
   28     28   
                input = input.set_token(
   29     29   
                    crate::protocol_serde::shape_query_idempotency_token_auto_fill_input::de_token(
   30     30   
                        &v,
   31     31   
                    )?,
   32     32   
                );
   33     33   
                token_seen = true;
   34     34   
            }
   35     35   
        }
   36     36   
        input.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_query_idempotency_token_auto_fill_http_response(
   42     42   
    #[allow(unused_variables)] output: crate::output::QueryIdempotencyTokenAutoFillOutput,
   43     43   
) -> std::result::Result<
   44         -
    ::aws_smithy_http_server::response::Response,
   45         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          44  +
    ::aws_smithy_legacy_http_server::response::Response,
          45  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   46     46   
> {
   47     47   
    Ok({
   48     48   
        #[allow(unused_mut)]
   49     49   
        let mut builder = ::http::Response::builder();
   50         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          50  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   51     51   
            builder,
   52     52   
            ::http::header::CONTENT_TYPE,
   53     53   
            "application/json",
   54     54   
        );
   55     55   
        let http_status: u16 = 200;
   56     56   
        builder = builder.status(http_status);
   57     57   
        let payload = "";
   58     58   
        let content_length = payload.len();
   59         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          59  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   60     60   
            builder,
   61     61   
            ::http::header::CONTENT_LENGTH,
   62     62   
            content_length,
   63     63   
        );
   64         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          64  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   65     65   
        builder.body(body)?
   66     66   
    })
   67     67   
}
   68     68   
   69     69   
#[allow(clippy::unnecessary_wraps)]
   70     70   
pub fn ser_query_idempotency_token_auto_fill_http_error(
   71     71   
    error: &crate::error::QueryIdempotencyTokenAutoFillError,
   72     72   
) -> std::result::Result<
   73         -
    ::aws_smithy_http_server::response::Response,
   74         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          73  +
    ::aws_smithy_legacy_http_server::response::Response,
          74  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   75     75   
> {
   76     76   
    Ok({
   77     77   
        match error {
   78     78   
            crate::error::QueryIdempotencyTokenAutoFillError::InternalServerError(output) => {
   79     79   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   80     80   
                #[allow(unused_mut)]
   81     81   
                let mut builder = ::http::Response::builder();
   82         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84     84   
                    ::http::header::CONTENT_TYPE,
   85     85   
                    "application/json",
   86     86   
                );
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90     90   
                    "InternalServerError",
   91     91   
                );
   92     92   
                let content_length = payload.len();
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95     95   
                    ::http::header::CONTENT_LENGTH,
   96     96   
                    content_length,
   97     97   
                );
   98     98   
                builder
   99     99   
                    .status(500)
  100         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         100  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  101    101   
            }
  102    102   
        }
  103    103   
    })
  104    104   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_query_idempotency_token_auto_fill_input.rs

@@ -1,1 +10,10 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_token(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = value.to_owned();
    9      9   
    Ok(Some(value))
   10     10   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_query_params_as_string_list_map.rs

@@ -1,1 +109,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_query_params_as_string_list_map_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::QueryParamsAsStringListMapInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::query_params_as_string_list_map_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        let query_string = uri.query().unwrap_or("");
   24     24   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   25     25   
        let mut query_params: ::std::collections::HashMap<
   26     26   
            ::std::string::String,
   27     27   
            ::std::vec::Vec<::std::string::String>,
   28     28   
        > = ::std::collections::HashMap::new();
   29     29   
        let mut qux_seen = false;
   30     30   
        for (k, v) in pairs {
   31     31   
            if !qux_seen && k == "corge" {
   32     32   
                input = input.set_qux(
   33     33   
                    crate::protocol_serde::shape_query_params_as_string_list_map_input::de_qux(&v)?,
   34     34   
                );
   35     35   
                qux_seen = true;
   36     36   
            }
   37     37   
            let entry = query_params.entry(String::from(k)).or_default();
   38     38   
            entry.push(String::from(v));
   39     39   
        }
   40     40   
        input = input.set_foo(Some(query_params));
   41     41   
        input.build()
   42     42   
    })
   43     43   
}
   44     44   
   45     45   
#[allow(clippy::unnecessary_wraps)]
   46     46   
pub fn ser_query_params_as_string_list_map_http_response(
   47     47   
    #[allow(unused_variables)] output: crate::output::QueryParamsAsStringListMapOutput,
   48     48   
) -> std::result::Result<
   49         -
    ::aws_smithy_http_server::response::Response,
   50         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          49  +
    ::aws_smithy_legacy_http_server::response::Response,
          50  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   51     51   
> {
   52     52   
    Ok({
   53     53   
        #[allow(unused_mut)]
   54     54   
        let mut builder = ::http::Response::builder();
   55         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57     57   
            ::http::header::CONTENT_TYPE,
   58     58   
            "application/json",
   59     59   
        );
   60     60   
        let http_status: u16 = 200;
   61     61   
        builder = builder.status(http_status);
   62     62   
        let payload = "";
   63     63   
        let content_length = payload.len();
   64         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          64  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   65     65   
            builder,
   66     66   
            ::http::header::CONTENT_LENGTH,
   67     67   
            content_length,
   68     68   
        );
   69         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          69  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   70     70   
        builder.body(body)?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_query_params_as_string_list_map_http_error(
   76     76   
    error: &crate::error::QueryParamsAsStringListMapError,
   77     77   
) -> std::result::Result<
   78         -
    ::aws_smithy_http_server::response::Response,
   79         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          78  +
    ::aws_smithy_legacy_http_server::response::Response,
          79  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   82     82   
        match error {
   83     83   
            crate::error::QueryParamsAsStringListMapError::InternalServerError(output) => {
   84     84   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   85     85   
                #[allow(unused_mut)]
   86     86   
                let mut builder = ::http::Response::builder();
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::CONTENT_TYPE,
   90     90   
                    "application/json",
   91     91   
                );
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   95     95   
                    "InternalServerError",
   96     96   
                );
   97     97   
                let content_length = payload.len();
   98         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          98  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   99     99   
                    builder,
  100    100   
                    ::http::header::CONTENT_LENGTH,
  101    101   
                    content_length,
  102    102   
                );
  103    103   
                builder
  104    104   
                    .status(500)
  105         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         105  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  106    106   
            }
  107    107   
        }
  108    108   
    })
  109    109   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_query_params_as_string_list_map_input.rs

@@ -1,1 +10,10 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_qux(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = value.to_owned();
    9      9   
    Ok(Some(value))
   10     10   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_query_precedence.rs

@@ -1,1 +109,109 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_query_precedence_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::QueryPrecedenceInput,
    7         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           7  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10         -
    B: ::aws_smithy_http_server::body::HttpBody + Send,
          10  +
    B: ::aws_smithy_legacy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          12  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          13  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::query_precedence_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let query_string = uri.query().unwrap_or("");
   23     23   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   24     24   
        let mut query_params: ::std::collections::HashMap<
   25     25   
            ::std::string::String,
   26     26   
            ::std::string::String,
   27     27   
        > = ::std::collections::HashMap::new();
   28     28   
        let mut foo_seen = false;
   29     29   
        for (k, v) in pairs {
   30     30   
            if !foo_seen && k == "bar" {
   31     31   
                input = input.set_foo(crate::protocol_serde::shape_query_precedence_input::de_foo(
   32     32   
                    &v,
   33     33   
                )?);
   34     34   
                foo_seen = true;
   35     35   
            }
   36     36   
            query_params
   37     37   
                .entry(String::from(k))
   38     38   
                .or_insert_with(|| String::from(v));
   39     39   
        }
   40     40   
        input = input.set_baz(Some(query_params));
   41     41   
        input.build()
   42     42   
    })
   43     43   
}
   44     44   
   45     45   
#[allow(clippy::unnecessary_wraps)]
   46     46   
pub fn ser_query_precedence_http_response(
   47     47   
    #[allow(unused_variables)] output: crate::output::QueryPrecedenceOutput,
   48     48   
) -> std::result::Result<
   49         -
    ::aws_smithy_http_server::response::Response,
   50         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          49  +
    ::aws_smithy_legacy_http_server::response::Response,
          50  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   51     51   
> {
   52     52   
    Ok({
   53     53   
        #[allow(unused_mut)]
   54     54   
        let mut builder = ::http::Response::builder();
   55         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          55  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   56     56   
            builder,
   57     57   
            ::http::header::CONTENT_TYPE,
   58     58   
            "application/json",
   59     59   
        );
   60     60   
        let http_status: u16 = 200;
   61     61   
        builder = builder.status(http_status);
   62     62   
        let payload = "";
   63     63   
        let content_length = payload.len();
   64         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          64  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   65     65   
            builder,
   66     66   
            ::http::header::CONTENT_LENGTH,
   67     67   
            content_length,
   68     68   
        );
   69         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          69  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   70     70   
        builder.body(body)?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_query_precedence_http_error(
   76     76   
    error: &crate::error::QueryPrecedenceError,
   77     77   
) -> std::result::Result<
   78         -
    ::aws_smithy_http_server::response::Response,
   79         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          78  +
    ::aws_smithy_legacy_http_server::response::Response,
          79  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   80     80   
> {
   81     81   
    Ok({
   82     82   
        match error {
   83     83   
            crate::error::QueryPrecedenceError::InternalServerError(output) => {
   84     84   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   85     85   
                #[allow(unused_mut)]
   86     86   
                let mut builder = ::http::Response::builder();
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::CONTENT_TYPE,
   90     90   
                    "application/json",
   91     91   
                );
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   95     95   
                    "InternalServerError",
   96     96   
                );
   97     97   
                let content_length = payload.len();
   98         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          98  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   99     99   
                    builder,
  100    100   
                    ::http::header::CONTENT_LENGTH,
  101    101   
                    content_length,
  102    102   
                );
  103    103   
                builder
  104    104   
                    .status(500)
  105         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         105  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  106    106   
            }
  107    107   
        }
  108    108   
    })
  109    109   
}