Server Test Python

Server Test Python

rev. ee474c7509d7728618c23068f3741e8e5b339ef9

Files changed:

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_query_precedence_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_foo(
    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_recursive_shapes.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_recursive_shapes_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::RecursiveShapesInput,
    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::recursive_shapes_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_recursive_shapes::de_recursive_shapes(
   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_recursive_shapes_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::RecursiveShapesOutput,
   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_recursive_shapes_output::ser_recursive_shapes_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_recursive_shapes_http_error(
   70     70   
    error: &crate::error::RecursiveShapesError,
   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::RecursiveShapesError::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_recursive_shapes(
  106    106   
    value: &[u8],
  107    107   
    mut builder: crate::input::recursive_shapes_input_internal::Builder,
  108    108   
) -> ::std::result::Result<
  109    109   
    crate::input::recursive_shapes_input_internal::Builder,

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

@@ -1,1 +93,93 @@
    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_response_code_http_fallback_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ResponseCodeHttpFallbackInput,
    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::response_code_http_fallback_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   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_response_code_http_fallback_http_response(
   29     29   
    #[allow(unused_variables)] output: crate::output::ResponseCodeHttpFallbackOutput,
   30     30   
) -> std::result::Result<
   31         -
    ::aws_smithy_http_server::response::Response,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          31  +
    ::aws_smithy_legacy_http_server::response::Response,
          32  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     33   
> {
   34     34   
    Ok({
   35     35   
        #[allow(unused_mut)]
   36     36   
        let mut builder = ::http::Response::builder();
   37         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          37  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   38     38   
            builder,
   39     39   
            ::http::header::CONTENT_TYPE,
   40     40   
            "application/json",
   41     41   
        );
   42     42   
        let http_status: u16 = 201;
   43     43   
        builder = builder.status(http_status);
   44     44   
        let payload =
   45     45   
            crate::protocol_serde::shape_response_code_http_fallback_output::ser_response_code_http_fallback_output_output_output(&output)?
   46     46   
        ;
   47     47   
        let content_length = payload.len();
   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_LENGTH,
   51     51   
            content_length,
   52     52   
        );
   53         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          53  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   54     54   
        builder.body(body)?
   55     55   
    })
   56     56   
}
   57     57   
   58     58   
#[allow(clippy::unnecessary_wraps)]
   59     59   
pub fn ser_response_code_http_fallback_http_error(
   60     60   
    error: &crate::error::ResponseCodeHttpFallbackError,
   61     61   
) -> std::result::Result<
   62         -
    ::aws_smithy_http_server::response::Response,
   63         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          62  +
    ::aws_smithy_legacy_http_server::response::Response,
          63  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     64   
> {
   65     65   
    Ok({
   66     66   
        match error {
   67     67   
            crate::error::ResponseCodeHttpFallbackError::InternalServerError(output) => {
   68     68   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   69     69   
                #[allow(unused_mut)]
   70     70   
                let mut builder = ::http::Response::builder();
   71         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          71  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   72     72   
                    builder,
   73     73   
                    ::http::header::CONTENT_TYPE,
   74     74   
                    "application/json",
   75     75   
                );
   76         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          76  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   77     77   
                    builder,
   78     78   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   79     79   
                    "InternalServerError",
   80     80   
                );
   81     81   
                let content_length = payload.len();
   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_LENGTH,
   85     85   
                    content_length,
   86     86   
                );
   87     87   
                builder
   88     88   
                    .status(500)
   89         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          89  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   90     90   
            }
   91     91   
        }
   92     92   
    })
   93     93   
}

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

@@ -1,1 +94,96 @@
    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_response_code_required_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ResponseCodeRequiredInput,
    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::response_code_required_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         -
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          22  +
        ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
          23  +
            &headers, None,
          24  +
        )?;
   23     25   
        input.build()
   24     26   
    })
   25     27   
}
   26     28   
   27     29   
#[allow(clippy::unnecessary_wraps)]
   28     30   
pub fn ser_response_code_required_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::ResponseCodeRequiredOutput,
   30     32   
) -> std::result::Result<
   31         -
    ::aws_smithy_http_server::response::Response,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     35   
> {
   34     36   
    Ok({
   35     37   
        #[allow(unused_mut)]
   36     38   
        let mut builder = ::http::Response::builder();
   37         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          39  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   38     40   
            builder,
   39     41   
            ::http::header::CONTENT_TYPE,
   40     42   
            "application/json",
   41     43   
        );
   42     44   
        let status = output.response_code;
   43         -
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
          45  +
        let http_status: u16 = status.try_into().map_err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   44     46   
        builder = builder.status(http_status);
   45     47   
        let payload =
   46     48   
            crate::protocol_serde::shape_response_code_required_output::ser_response_code_required_output_output_output(&output)?
   47     49   
        ;
   48     50   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     52   
            builder,
   51     53   
            ::http::header::CONTENT_LENGTH,
   52     54   
            content_length,
   53     55   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     57   
        builder.body(body)?
   56     58   
    })
   57     59   
}
   58     60   
   59     61   
#[allow(clippy::unnecessary_wraps)]
   60     62   
pub fn ser_response_code_required_http_error(
   61     63   
    error: &crate::error::ResponseCodeRequiredError,
   62     64   
) -> std::result::Result<
   63         -
    ::aws_smithy_http_server::response::Response,
   64         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          65  +
    ::aws_smithy_legacy_http_server::response::Response,
          66  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     67   
> {
   66     68   
    Ok({
   67     69   
        match error {
   68     70   
            crate::error::ResponseCodeRequiredError::InternalServerError(output) => {
   69     71   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   70     72   
                #[allow(unused_mut)]
   71     73   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          74  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     75   
                    builder,
   74     76   
                    ::http::header::CONTENT_TYPE,
   75     77   
                    "application/json",
   76     78   
                );
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     80   
                    builder,
   79     81   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80     82   
                    "InternalServerError",
   81     83   
                );
   82     84   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     86   
                    builder,
   85     87   
                    ::http::header::CONTENT_LENGTH,
   86     88   
                    content_length,
   87     89   
                );
   88     90   
                builder
   89     91   
                    .status(500)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          92  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     93   
            }
   92     94   
        }
   93     95   
    })
   94     96   
}

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

@@ -1,1 +136,136 @@
    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_simple_scalar_properties_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::SimpleScalarPropertiesInput,
    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::simple_scalar_properties_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_simple_scalar_properties::de_simple_scalar_properties(
   30     30   
                    bytes.as_ref(),
   31     31   
                    input,
   32     32   
                )?;
   33     33   
        }
   34     34   
        if let Some(value) =
   35     35   
            crate::protocol_serde::shape_simple_scalar_properties_input::de_foo_header(&headers)?
   36     36   
        {
   37     37   
            input = input.set_foo(Some(value))
   38     38   
        }
   39     39   
        input.build()
   40     40   
    })
   41     41   
}
   42     42   
   43     43   
#[allow(clippy::unnecessary_wraps)]
   44     44   
pub fn ser_simple_scalar_properties_http_response(
   45     45   
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
   46     46   
) -> std::result::Result<
   47         -
    ::aws_smithy_http_server::response::Response,
   48         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          47  +
    ::aws_smithy_legacy_http_server::response::Response,
          48  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   49     49   
> {
   50     50   
    Ok({
   51     51   
        #[allow(unused_mut)]
   52     52   
        let mut builder = ::http::Response::builder();
   53     53   
        builder = crate::protocol_serde::shape_simple_scalar_properties::ser_simple_scalar_properties_headers(&output, builder)?;
   54         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   55     55   
            builder,
   56     56   
            ::http::header::CONTENT_TYPE,
   57     57   
            "application/json",
   58     58   
        );
   59     59   
        let http_status: u16 = 200;
   60     60   
        builder = builder.status(http_status);
   61     61   
        let payload =
   62     62   
            crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
   63     63   
        ;
   64     64   
        let content_length = payload.len();
   65         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          65  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   66     66   
            builder,
   67     67   
            ::http::header::CONTENT_LENGTH,
   68     68   
            content_length,
   69     69   
        );
   70         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          70  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   71     71   
        builder.body(body)?
   72     72   
    })
   73     73   
}
   74     74   
   75     75   
#[allow(clippy::unnecessary_wraps)]
   76     76   
pub fn ser_simple_scalar_properties_http_error(
   77     77   
    error: &crate::error::SimpleScalarPropertiesError,
   78     78   
) -> std::result::Result<
   79         -
    ::aws_smithy_http_server::response::Response,
   80         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          79  +
    ::aws_smithy_legacy_http_server::response::Response,
          80  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   81     81   
> {
   82     82   
    Ok({
   83     83   
        match error {
   84     84   
            crate::error::SimpleScalarPropertiesError::InternalServerError(output) => {
   85     85   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   86     86   
                #[allow(unused_mut)]
   87     87   
                let mut builder = ::http::Response::builder();
   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::CONTENT_TYPE,
   91     91   
                    "application/json",
   92     92   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   96     96   
                    "InternalServerError",
   97     97   
                );
   98     98   
                let content_length = payload.len();
   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_LENGTH,
  102    102   
                    content_length,
  103    103   
                );
  104    104   
                builder
  105    105   
                    .status(500)
  106         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         106  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  107    107   
            }
  108    108   
        }
  109    109   
    })
  110    110   
}
  111    111   
  112    112   
pub(crate) fn de_simple_scalar_properties(
  113    113   
    value: &[u8],
  114    114   
    mut builder: crate::input::simple_scalar_properties_input_internal::Builder,
  115    115   
) -> ::std::result::Result<
  116    116   
    crate::input::simple_scalar_properties_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_simple_scalar_properties_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_foo_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-Foo");
    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_sparse_json_lists.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_sparse_json_lists_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::SparseJsonListsInput,
    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::sparse_json_lists_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_sparse_json_lists::de_sparse_json_lists(
   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_sparse_json_lists_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::SparseJsonListsOutput,
   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_sparse_json_lists_output::ser_sparse_json_lists_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_sparse_json_lists_http_error(
   70     70   
    error: &crate::error::SparseJsonListsError,
   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::SparseJsonListsError::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_sparse_json_lists(
  106    106   
    value: &[u8],
  107    107   
    mut builder: crate::input::sparse_json_lists_input_internal::Builder,
  108    108   
) -> ::std::result::Result<
  109    109   
    crate::input::sparse_json_lists_input_internal::Builder,

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

@@ -1,1 +153,153 @@
    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_sparse_json_maps_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::SparseJsonMapsInput,
    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::sparse_json_maps_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_sparse_json_maps::de_sparse_json_maps(
   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_sparse_json_maps_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::SparseJsonMapsOutput,
   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_sparse_json_maps_output::ser_sparse_json_maps_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_sparse_json_maps_http_error(
   70     70   
    error: &crate::error::SparseJsonMapsError,
   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::SparseJsonMapsError::ValidationException(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_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   
                    "ValidationException",
   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(400)
   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   
            crate::error::SparseJsonMapsError::InternalServerError(output) => {
  102    102   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  103    103   
                #[allow(unused_mut)]
  104    104   
                let mut builder = ::http::Response::builder();
  105         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         105  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  106    106   
                    builder,
  107    107   
                    ::http::header::CONTENT_TYPE,
  108    108   
                    "application/json",
  109    109   
                );
  110         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         110  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  111    111   
                    builder,
  112    112   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  113    113   
                    "InternalServerError",
  114    114   
                );
  115    115   
                let content_length = payload.len();
  116         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         116  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  117    117   
                    builder,
  118    118   
                    ::http::header::CONTENT_LENGTH,
  119    119   
                    content_length,
  120    120   
                );
  121    121   
                builder
  122    122   
                    .status(500)
  123         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         123  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  124    124   
            }
  125    125   
        }
  126    126   
    })
  127    127   
}
  128    128   
  129    129   
pub(crate) fn de_sparse_json_maps(
  130    130   
    value: &[u8],
  131    131   
    mut builder: crate::input::sparse_json_maps_input_internal::Builder,
  132    132   
) -> ::std::result::Result<
  133    133   
    crate::input::sparse_json_maps_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_streaming_traits.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_streaming_traits_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StreamingTraitsInput,
    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: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     12   
    B::Data: Send,
   13         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          13  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          14  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   15     15   
{
   16     16   
    Ok({
   17     17   
        #[allow(unused_mut)]
   18     18   
        let mut input = crate::input::streaming_traits_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   
            Some(
   25     25   
                crate::protocol_serde::shape_streaming_traits_input::de_blob_payload(
   26     26   
                    &mut body.into().into_inner(),
   27     27   
                )?,
   28     28   
            )
   29     29   
        } {
   30     30   
            input = input.set_blob(value)
   31     31   
        }
   32     32   
        if let Some(value) =
   33     33   
            crate::protocol_serde::shape_streaming_traits_input::de_foo_header(&headers)?
   34     34   
        {
   35     35   
            input = input.set_foo(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_streaming_traits_http_response(
   43     43   
    #[allow(unused_variables)] output: crate::output::StreamingTraitsOutput,
   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     51   
        builder = crate::protocol_serde::shape_streaming_traits::ser_streaming_traits_headers(
   52     52   
            &output, builder,
   53     53   
        )?;
   54         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   55     55   
            builder,
   56     56   
            ::http::header::CONTENT_TYPE,
   57     57   
            "application/octet-stream",
   58     58   
        );
   59     59   
        let http_status: u16 = 200;
   60     60   
        builder = builder.status(http_status);
   61         -
        let body = ::aws_smithy_http_server::body::boxed(
   62         -
            ::aws_smithy_http_server::body::Body::wrap_stream(
          61  +
        let body = ::aws_smithy_legacy_http_server::body::boxed(
          62  +
            ::aws_smithy_legacy_http_server::body::Body::wrap_stream(
   63     63   
                crate::protocol_serde::shape_streaming_traits_output::ser_blob_http_payload(
   64     64   
                    output.blob,
   65     65   
                )?,
   66     66   
            ),
   67     67   
        );
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_streaming_traits_http_error(
   74     74   
    error: &crate::error::StreamingTraitsError,
   75     75   
) -> std::result::Result<
   76         -
    ::aws_smithy_http_server::response::Response,
   77         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          76  +
    ::aws_smithy_legacy_http_server::response::Response,
          77  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::StreamingTraitsError::InternalServerError(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84     84   
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   86     86   
                    builder,
   87     87   
                    ::http::header::CONTENT_TYPE,
   88     88   
                    "application/octet-stream",
   89     89   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                    "InternalServerError",
   94     94   
                );
   95     95   
                let content_length = payload.len();
   96         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          96  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98     98   
                    ::http::header::CONTENT_LENGTH,
   99     99   
                    content_length,
  100    100   
                );
  101    101   
                builder
  102    102   
                    .status(500)
  103         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         103  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  104    104   
            }
  105    105   
        }
  106    106   
    })
  107    107   
}
  108    108   
  109    109   
pub fn ser_streaming_traits_headers(
  110    110   
    input: &crate::output::StreamingTraitsOutput,
  111    111   
    mut builder: ::http::response::Builder,
  112    112   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  113    113   
{

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

@@ -1,1 +23,23 @@
    9      9   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     10   
    Ok(::aws_smithy_http_server_python::types::ByteStream::new(
   11     11   
        body,
   12     12   
    ))
   13     13   
}
   14     14   
   15     15   
pub(crate) fn de_foo_header(
   16     16   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   17     17   
) -> ::std::result::Result<
   18     18   
    ::std::option::Option<::std::string::String>,
   19         -
    ::aws_smithy_http::header::ParseError,
          19  +
    ::aws_smithy_legacy_http::header::ParseError,
   20     20   
> {
   21     21   
    let headers = header_map.get_all("X-Foo");
   22         -
    ::aws_smithy_http::header::one_or_none(headers)
          22  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   23     23   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_streaming_traits_require_length.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_streaming_traits_require_length_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StreamingTraitsRequireLengthInput,
    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: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     12   
    B::Data: Send,
   13         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          13  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          14  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   15     15   
{
   16     16   
    Ok({
   17     17   
        #[allow(unused_mut)]
   18     18   
        let mut input =
   19     19   
            crate::input::streaming_traits_require_length_input_internal::Builder::default();
   20     20   
        #[allow(unused_variables)]
   21     21   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     22   
            uri, headers, body, ..
   23     23   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   24     24   
        if let Some(value) = {
   25     25   
            Some(crate::protocol_serde::shape_streaming_traits_require_length_input::de_blob_payload(&mut body.into().into_inner())?)
   26     26   
        } {
   27     27   
            input = input.set_blob(value)
   28     28   
        }
   29     29   
        if let Some(value) =
   30     30   
            crate::protocol_serde::shape_streaming_traits_require_length_input::de_foo_header(
   31     31   
                &headers,
   32     32   
            )?
   33     33   
        {
   34     34   
            input = input.set_foo(Some(value))
   35     35   
        }
   36     36   
        input.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_streaming_traits_require_length_http_response(
   42     42   
    #[allow(unused_variables)] output: crate::output::StreamingTraitsRequireLengthOutput,
   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_streaming_traits_require_length_http_error(
   71     71   
    error: &crate::error::StreamingTraitsRequireLengthError,
   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::StreamingTraitsRequireLengthError::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_streaming_traits_require_length_input.rs

@@ -1,1 +23,23 @@
    9      9   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     10   
    Ok(::aws_smithy_http_server_python::types::ByteStream::new(
   11     11   
        body,
   12     12   
    ))
   13     13   
}
   14     14   
   15     15   
pub(crate) fn de_foo_header(
   16     16   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   17     17   
) -> ::std::result::Result<
   18     18   
    ::std::option::Option<::std::string::String>,
   19         -
    ::aws_smithy_http::header::ParseError,
          19  +
    ::aws_smithy_legacy_http::header::ParseError,
   20     20   
> {
   21     21   
    let headers = header_map.get_all("X-Foo");
   22         -
    ::aws_smithy_http::header::one_or_none(headers)
          22  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   23     23   
}

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

@@ -1,1 +124,124 @@
    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_streaming_traits_with_media_type_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StreamingTraitsWithMediaTypeInput,
    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: Into<::aws_smithy_types::byte_stream::ByteStream>,
   12     12   
    B::Data: Send,
   13         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   14         -
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
          13  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection:
          14  +
        From<<B as ::aws_smithy_legacy_http_server::body::HttpBody>::Error>,
   15     15   
{
   16     16   
    Ok({
   17     17   
        #[allow(unused_mut)]
   18     18   
        let mut input =
   19     19   
            crate::input::streaming_traits_with_media_type_input_internal::Builder::default();
   20     20   
        #[allow(unused_variables)]
   21     21   
        let ::aws_smithy_runtime_api::http::RequestParts {
   22     22   
            uri, headers, body, ..
   23     23   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   24     24   
        if let Some(value) = {
   25     25   
            Some(crate::protocol_serde::shape_streaming_traits_with_media_type_input::de_blob_payload(&mut body.into().into_inner())?)
   26     26   
        } {
   27     27   
            input = input.set_blob(value)
   28     28   
        }
   29     29   
        if let Some(value) =
   30     30   
            crate::protocol_serde::shape_streaming_traits_with_media_type_input::de_foo_header(
   31     31   
                &headers,
   32     32   
            )?
   33     33   
        {
   34     34   
            input = input.set_foo(Some(value))
   35     35   
        }
   36     36   
        input.build()
   37     37   
    })
   38     38   
}
   39     39   
   40     40   
#[allow(clippy::unnecessary_wraps)]
   41     41   
pub fn ser_streaming_traits_with_media_type_http_response(
   42     42   
    #[allow(unused_variables)] output: crate::output::StreamingTraitsWithMediaTypeOutput,
   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     50   
        builder = crate::protocol_serde::shape_streaming_traits_with_media_type::ser_streaming_traits_with_media_type_headers(&output, 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   
            "text/plain",
   55     55   
        );
   56     56   
        let http_status: u16 = 200;
   57     57   
        builder = builder.status(http_status);
   58         -
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::Body::wrap_stream(
          58  +
        let body = ::aws_smithy_legacy_http_server::body::boxed(::aws_smithy_legacy_http_server::body::Body::wrap_stream(
   59     59   
            crate::protocol_serde::shape_streaming_traits_with_media_type_output::ser_blob_http_payload( output.blob)?
   60     60   
        ));
   61     61   
        builder.body(body)?
   62     62   
    })
   63     63   
}
   64     64   
   65     65   
#[allow(clippy::unnecessary_wraps)]
   66     66   
pub fn ser_streaming_traits_with_media_type_http_error(
   67     67   
    error: &crate::error::StreamingTraitsWithMediaTypeError,
   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::StreamingTraitsWithMediaTypeError::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   
                    "text/plain",
   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 fn ser_streaming_traits_with_media_type_headers(
  103    103   
    input: &crate::output::StreamingTraitsWithMediaTypeOutput,
  104    104   
    mut builder: ::http::response::Builder,
  105    105   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  106    106   
{

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

@@ -1,1 +23,23 @@
    9      9   
    let body = std::mem::replace(body, ::aws_smithy_types::body::SdkBody::taken());
   10     10   
    Ok(::aws_smithy_http_server_python::types::ByteStream::new(
   11     11   
        body,
   12     12   
    ))
   13     13   
}
   14     14   
   15     15   
pub(crate) fn de_foo_header(
   16     16   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   17     17   
) -> ::std::result::Result<
   18     18   
    ::std::option::Option<::std::string::String>,
   19         -
    ::aws_smithy_http::header::ParseError,
          19  +
    ::aws_smithy_legacy_http::header::ParseError,
   20     20   
> {
   21     21   
    let headers = header_map.get_all("X-Foo");
   22         -
    ::aws_smithy_http::header::one_or_none(headers)
          22  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   23     23   
}

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

@@ -1,1 +138,138 @@
    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_test_body_structure_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::TestBodyStructureInput,
    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::test_body_structure_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_test_body_structure::de_test_body_structure(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_test_body_structure_input::de_test_id_header(&headers)?
   35     35   
        {
   36     36   
            input = input.set_test_id(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_test_body_structure_http_response(
   44     44   
    #[allow(unused_variables)] output: crate::output::TestBodyStructureOutput,
   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 =
   53     53   
            crate::protocol_serde::shape_test_body_structure::ser_test_body_structure_headers(
   54     54   
                &output, builder,
   55     55   
            )?;
   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_TYPE,
   59     59   
            "application/json",
   60     60   
        );
   61     61   
        let http_status: u16 = 200;
   62     62   
        builder = builder.status(http_status);
   63     63   
        let payload =
   64     64   
            crate::protocol_serde::shape_test_body_structure_output::ser_test_body_structure_output_output_output(&output)?
   65     65   
        ;
   66     66   
        let content_length = payload.len();
   67         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          67  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   68     68   
            builder,
   69     69   
            ::http::header::CONTENT_LENGTH,
   70     70   
            content_length,
   71     71   
        );
   72         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          72  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   73     73   
        builder.body(body)?
   74     74   
    })
   75     75   
}
   76     76   
   77     77   
#[allow(clippy::unnecessary_wraps)]
   78     78   
pub fn ser_test_body_structure_http_error(
   79     79   
    error: &crate::error::TestBodyStructureError,
   80     80   
) -> std::result::Result<
   81         -
    ::aws_smithy_http_server::response::Response,
   82         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          81  +
    ::aws_smithy_legacy_http_server::response::Response,
          82  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   83     83   
> {
   84     84   
    Ok({
   85     85   
        match error {
   86     86   
            crate::error::TestBodyStructureError::InternalServerError(output) => {
   87     87   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   88     88   
                #[allow(unused_mut)]
   89     89   
                let mut builder = ::http::Response::builder();
   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_TYPE,
   93     93   
                    "application/json",
   94     94   
                );
   95         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          95  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   96     96   
                    builder,
   97     97   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   98     98   
                    "InternalServerError",
   99     99   
                );
  100    100   
                let content_length = payload.len();
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         101  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  102    102   
                    builder,
  103    103   
                    ::http::header::CONTENT_LENGTH,
  104    104   
                    content_length,
  105    105   
                );
  106    106   
                builder
  107    107   
                    .status(500)
  108         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         108  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  109    109   
            }
  110    110   
        }
  111    111   
    })
  112    112   
}
  113    113   
  114    114   
pub(crate) fn de_test_body_structure(
  115    115   
    value: &[u8],
  116    116   
    mut builder: crate::input::test_body_structure_input_internal::Builder,
  117    117   
) -> ::std::result::Result<
  118    118   
    crate::input::test_body_structure_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_test_body_structure_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_test_id_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-amz-test-id");
    9         -
    ::aws_smithy_http::header::one_or_none(headers)
           9  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   10     10   
}