Server Test Python

Server Test Python

rev. d06a46cae0f385cdae37a9f8264db3469a090ab5 (ignoring whitespace)

Files changed:

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

@@ -1,1 +14,14 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_payload_payload(
    3      3   
    body: &[u8],
    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   
    (!body.is_empty())
    9      9   
        .then(|| {
   10     10   
            let body_str = std::str::from_utf8(body)?;
   11     11   
            Ok(body_str.to_string())
   12     12   
        })
   13     13   
        .transpose()
   14     14   
}

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

@@ -1,1 +103,103 @@
    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_malformed_content_type_with_payload_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedContentTypeWithPayloadInput,
    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::malformed_content_type_with_payload_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   
            let bytes = ::hyper::body::to_bytes(body).await?;
   25     25   
            if !bytes.is_empty() {
   26         -
                ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          26  +
                ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   27     27   
                    &headers,
   28     28   
                    Some("image/jpeg"),
   29     29   
                )?;
   30     30   
            }
   31     31   
            crate::protocol_serde::shape_malformed_content_type_with_payload_input::de_payload_payload(&bytes)?
   32     32   
        } {
   33     33   
            input = input.set_payload(Some(value))
   34     34   
        }
   35     35   
        input.build()
   36     36   
    })
   37     37   
}
   38     38   
   39     39   
#[allow(clippy::unnecessary_wraps)]
   40     40   
pub fn ser_malformed_content_type_with_payload_http_response(
   41     41   
    #[allow(unused_variables)] output: crate::output::MalformedContentTypeWithPayloadOutput,
   42     42   
) -> std::result::Result<
   43         -
    ::aws_smithy_http_server::response::Response,
   44         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          43  +
    ::aws_smithy_legacy_http_server::response::Response,
          44  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     45   
> {
   46     46   
    Ok({
   47     47   
        #[allow(unused_mut)]
   48     48   
        let mut builder = ::http::Response::builder();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51     51   
            ::http::header::CONTENT_TYPE,
   52     52   
            "application/json",
   53     53   
        );
   54     54   
        let http_status: u16 = 200;
   55     55   
        builder = builder.status(http_status);
   56     56   
        let payload = "";
   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_malformed_content_type_with_payload_http_error(
   70     70   
    error: &crate::error::MalformedContentTypeWithPayloadError,
   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::MalformedContentTypeWithPayloadError::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   
}

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

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

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

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_content_type_without_body_empty_input_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_header_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("header");
    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_malformed_double.rs

@@ -1,1 +190,190 @@
    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_malformed_double_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedDoubleInput,
    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::malformed_double_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_malformed_double::de_malformed_double(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_malformed_double_input::de_double_in_header_header(
   35     35   
                &headers,
   36     36   
            )?
   37     37   
        {
   38     38   
            input = input.set_double_in_header(Some(value))
   39     39   
        }
   40     40   
        let input_string = uri.path();
   41     41   
        let (input_string, (_, m1)) =
   42     42   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   43     43   
                ::nom::sequence::preceded(
   44     44   
                    ::nom::bytes::complete::tag("/"),
   45     45   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   46     46   
                        "MalformedDouble",
   47     47   
                    ),
   48     48   
                ),
   49     49   
                ::nom::sequence::preceded(
   50     50   
                    ::nom::bytes::complete::tag("/"),
   51     51   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   52     52   
                        ::nom::bytes::complete::take_until("/"),
   53     53   
                        ::nom::combinator::rest,
   54     54   
                    )),
   55     55   
                ),
   56     56   
            ))(input_string)?;
   57     57   
        debug_assert_eq!("", input_string);
   58     58   
        input = input.set_double_in_path(
   59     59   
            crate::protocol_serde::shape_malformed_double_input::de_double_in_path(m1)?,
   60     60   
        );
   61     61   
        let query_string = uri.query().unwrap_or("");
   62     62   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   63     63   
        let mut double_in_query_seen = false;
   64     64   
        for (k, v) in pairs {
   65     65   
            if !double_in_query_seen && k == "doubleInQuery" {
   66     66   
                input = input.set_double_in_query(
   67     67   
                    crate::protocol_serde::shape_malformed_double_input::de_double_in_query(&v)?,
   68     68   
                );
   69     69   
                double_in_query_seen = true;
   70     70   
            }
   71     71   
        }
   72     72   
        input.build()?
   73     73   
    })
   74     74   
}
   75     75   
   76     76   
#[allow(clippy::unnecessary_wraps)]
   77     77   
pub fn ser_malformed_double_http_response(
   78     78   
    #[allow(unused_variables)] output: crate::output::MalformedDoubleOutput,
   79     79   
) -> std::result::Result<
   80         -
    ::aws_smithy_http_server::response::Response,
   81         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          80  +
    ::aws_smithy_legacy_http_server::response::Response,
          81  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   82     82   
> {
   83     83   
    Ok({
   84     84   
        #[allow(unused_mut)]
   85     85   
        let mut builder = ::http::Response::builder();
   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::CONTENT_TYPE,
   89     89   
            "application/json",
   90     90   
        );
   91     91   
        let http_status: u16 = 200;
   92     92   
        builder = builder.status(http_status);
   93     93   
        let payload = "";
   94     94   
        let content_length = payload.len();
   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::CONTENT_LENGTH,
   98     98   
            content_length,
   99     99   
        );
  100         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         100  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  101    101   
        builder.body(body)?
  102    102   
    })
  103    103   
}
  104    104   
  105    105   
#[allow(clippy::unnecessary_wraps)]
  106    106   
pub fn ser_malformed_double_http_error(
  107    107   
    error: &crate::error::MalformedDoubleError,
  108    108   
) -> std::result::Result<
  109         -
    ::aws_smithy_http_server::response::Response,
  110         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         109  +
    ::aws_smithy_legacy_http_server::response::Response,
         110  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  111    111   
> {
  112    112   
    Ok({
  113    113   
        match error {
  114    114   
            crate::error::MalformedDoubleError::ValidationException(output) => {
  115    115   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  116    116   
                #[allow(unused_mut)]
  117    117   
                let mut builder = ::http::Response::builder();
  118         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         118  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  119    119   
                    builder,
  120    120   
                    ::http::header::CONTENT_TYPE,
  121    121   
                    "application/json",
  122    122   
                );
  123         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         123  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  124    124   
                    builder,
  125    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  126    126   
                    "ValidationException",
  127    127   
                );
  128    128   
                let content_length = payload.len();
  129         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         129  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  130    130   
                    builder,
  131    131   
                    ::http::header::CONTENT_LENGTH,
  132    132   
                    content_length,
  133    133   
                );
  134    134   
                builder
  135    135   
                    .status(400)
  136         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  137    137   
            }
  138    138   
            crate::error::MalformedDoubleError::InternalServerError(output) => {
  139    139   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  140    140   
                #[allow(unused_mut)]
  141    141   
                let mut builder = ::http::Response::builder();
  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_TYPE,
  145    145   
                    "application/json",
  146    146   
                );
  147         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         147  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  148    148   
                    builder,
  149    149   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  150    150   
                    "InternalServerError",
  151    151   
                );
  152    152   
                let content_length = payload.len();
  153         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         153  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  154    154   
                    builder,
  155    155   
                    ::http::header::CONTENT_LENGTH,
  156    156   
                    content_length,
  157    157   
                );
  158    158   
                builder
  159    159   
                    .status(500)
  160         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         160  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  161    161   
            }
  162    162   
        }
  163    163   
    })
  164    164   
}
  165    165   
  166    166   
pub(crate) fn de_malformed_double(
  167    167   
    value: &[u8],
  168    168   
    mut builder: crate::input::malformed_double_input_internal::Builder,
  169    169   
) -> ::std::result::Result<
  170    170   
    crate::input::malformed_double_input_internal::Builder,

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

@@ -1,1 +36,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_double_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("doubleInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<f64>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<f64>(headers)?;
    7      8   
    if var_1.len() > 1 {
    8         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
           9  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
    9     10   
            "expected one item but found {}",
   10     11   
            var_1.len()
   11     12   
        )))
   12     13   
    } else {
   13     14   
        let mut var_1 = var_1;
   14     15   
        Ok(var_1.pop())
   15     16   
    }
   16     17   
}
   17     18   
   18     19   
pub fn de_double_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    f64,
   22         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          23  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   23     24   
> {
   24     25   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   25     26   
    Ok(value)
   26     27   
}
   27     28   
   28     29   
pub fn de_double_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<f64>,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          33  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   33     34   
> {
   34     35   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   35     36   
    Ok(Some(value))
   36     37   
}

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

@@ -1,1 +188,188 @@
    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_malformed_float_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedFloatInput,
    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::malformed_float_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_malformed_float::de_malformed_float(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_malformed_float_input::de_float_in_header_header(&headers)?
   35     35   
        {
   36     36   
            input = input.set_float_in_header(Some(value))
   37     37   
        }
   38     38   
        let input_string = uri.path();
   39     39   
        let (input_string, (_, m1)) =
   40     40   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   41     41   
                ::nom::sequence::preceded(
   42     42   
                    ::nom::bytes::complete::tag("/"),
   43     43   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   44     44   
                        "MalformedFloat",
   45     45   
                    ),
   46     46   
                ),
   47     47   
                ::nom::sequence::preceded(
   48     48   
                    ::nom::bytes::complete::tag("/"),
   49     49   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   50     50   
                        ::nom::bytes::complete::take_until("/"),
   51     51   
                        ::nom::combinator::rest,
   52     52   
                    )),
   53     53   
                ),
   54     54   
            ))(input_string)?;
   55     55   
        debug_assert_eq!("", input_string);
   56     56   
        input = input.set_float_in_path(
   57     57   
            crate::protocol_serde::shape_malformed_float_input::de_float_in_path(m1)?,
   58     58   
        );
   59     59   
        let query_string = uri.query().unwrap_or("");
   60     60   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   61     61   
        let mut float_in_query_seen = false;
   62     62   
        for (k, v) in pairs {
   63     63   
            if !float_in_query_seen && k == "floatInQuery" {
   64     64   
                input = input.set_float_in_query(
   65     65   
                    crate::protocol_serde::shape_malformed_float_input::de_float_in_query(&v)?,
   66     66   
                );
   67     67   
                float_in_query_seen = true;
   68     68   
            }
   69     69   
        }
   70     70   
        input.build()?
   71     71   
    })
   72     72   
}
   73     73   
   74     74   
#[allow(clippy::unnecessary_wraps)]
   75     75   
pub fn ser_malformed_float_http_response(
   76     76   
    #[allow(unused_variables)] output: crate::output::MalformedFloatOutput,
   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   
        #[allow(unused_mut)]
   83     83   
        let mut builder = ::http::Response::builder();
   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::CONTENT_TYPE,
   87     87   
            "application/json",
   88     88   
        );
   89     89   
        let http_status: u16 = 200;
   90     90   
        builder = builder.status(http_status);
   91     91   
        let payload = "";
   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         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          98  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   99     99   
        builder.body(body)?
  100    100   
    })
  101    101   
}
  102    102   
  103    103   
#[allow(clippy::unnecessary_wraps)]
  104    104   
pub fn ser_malformed_float_http_error(
  105    105   
    error: &crate::error::MalformedFloatError,
  106    106   
) -> std::result::Result<
  107         -
    ::aws_smithy_http_server::response::Response,
  108         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         107  +
    ::aws_smithy_legacy_http_server::response::Response,
         108  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  109    109   
> {
  110    110   
    Ok({
  111    111   
        match error {
  112    112   
            crate::error::MalformedFloatError::ValidationException(output) => {
  113    113   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  114    114   
                #[allow(unused_mut)]
  115    115   
                let mut builder = ::http::Response::builder();
  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_TYPE,
  119    119   
                    "application/json",
  120    120   
                );
  121         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         121  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  122    122   
                    builder,
  123    123   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  124    124   
                    "ValidationException",
  125    125   
                );
  126    126   
                let content_length = payload.len();
  127         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         127  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  128    128   
                    builder,
  129    129   
                    ::http::header::CONTENT_LENGTH,
  130    130   
                    content_length,
  131    131   
                );
  132    132   
                builder
  133    133   
                    .status(400)
  134         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  135    135   
            }
  136    136   
            crate::error::MalformedFloatError::InternalServerError(output) => {
  137    137   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  138    138   
                #[allow(unused_mut)]
  139    139   
                let mut builder = ::http::Response::builder();
  140         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         140  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  141    141   
                    builder,
  142    142   
                    ::http::header::CONTENT_TYPE,
  143    143   
                    "application/json",
  144    144   
                );
  145         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         145  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  146    146   
                    builder,
  147    147   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  148    148   
                    "InternalServerError",
  149    149   
                );
  150    150   
                let content_length = payload.len();
  151         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         151  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  152    152   
                    builder,
  153    153   
                    ::http::header::CONTENT_LENGTH,
  154    154   
                    content_length,
  155    155   
                );
  156    156   
                builder
  157    157   
                    .status(500)
  158         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         158  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  159    159   
            }
  160    160   
        }
  161    161   
    })
  162    162   
}
  163    163   
  164    164   
pub(crate) fn de_malformed_float(
  165    165   
    value: &[u8],
  166    166   
    mut builder: crate::input::malformed_float_input_internal::Builder,
  167    167   
) -> ::std::result::Result<
  168    168   
    crate::input::malformed_float_input_internal::Builder,

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

@@ -1,1 +36,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_float_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("floatInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<f32>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<f32>(headers)?;
    7      8   
    if var_1.len() > 1 {
    8         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
           9  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
    9     10   
            "expected one item but found {}",
   10     11   
            var_1.len()
   11     12   
        )))
   12     13   
    } else {
   13     14   
        let mut var_1 = var_1;
   14     15   
        Ok(var_1.pop())
   15     16   
    }
   16     17   
}
   17     18   
   18     19   
pub fn de_float_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    f32,
   22         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          23  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   23     24   
> {
   24     25   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   25     26   
    Ok(value)
   26     27   
}
   27     28   
   28     29   
pub fn de_float_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<f32>,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          33  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   33     34   
> {
   34     35   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   35     36   
    Ok(Some(value))
   36     37   
}

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

@@ -1,1 +190,190 @@
    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_malformed_integer_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedIntegerInput,
    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::malformed_integer_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_malformed_integer::de_malformed_integer(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_malformed_integer_input::de_integer_in_header_header(
   35     35   
                &headers,
   36     36   
            )?
   37     37   
        {
   38     38   
            input = input.set_integer_in_header(Some(value))
   39     39   
        }
   40     40   
        let input_string = uri.path();
   41     41   
        let (input_string, (_, m1)) =
   42     42   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   43     43   
                ::nom::sequence::preceded(
   44     44   
                    ::nom::bytes::complete::tag("/"),
   45     45   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   46     46   
                        "MalformedInteger",
   47     47   
                    ),
   48     48   
                ),
   49     49   
                ::nom::sequence::preceded(
   50     50   
                    ::nom::bytes::complete::tag("/"),
   51     51   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   52     52   
                        ::nom::bytes::complete::take_until("/"),
   53     53   
                        ::nom::combinator::rest,
   54     54   
                    )),
   55     55   
                ),
   56     56   
            ))(input_string)?;
   57     57   
        debug_assert_eq!("", input_string);
   58     58   
        input = input.set_integer_in_path(
   59     59   
            crate::protocol_serde::shape_malformed_integer_input::de_integer_in_path(m1)?,
   60     60   
        );
   61     61   
        let query_string = uri.query().unwrap_or("");
   62     62   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   63     63   
        let mut integer_in_query_seen = false;
   64     64   
        for (k, v) in pairs {
   65     65   
            if !integer_in_query_seen && k == "integerInQuery" {
   66     66   
                input = input.set_integer_in_query(
   67     67   
                    crate::protocol_serde::shape_malformed_integer_input::de_integer_in_query(&v)?,
   68     68   
                );
   69     69   
                integer_in_query_seen = true;
   70     70   
            }
   71     71   
        }
   72     72   
        input.build()?
   73     73   
    })
   74     74   
}
   75     75   
   76     76   
#[allow(clippy::unnecessary_wraps)]
   77     77   
pub fn ser_malformed_integer_http_response(
   78     78   
    #[allow(unused_variables)] output: crate::output::MalformedIntegerOutput,
   79     79   
) -> std::result::Result<
   80         -
    ::aws_smithy_http_server::response::Response,
   81         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          80  +
    ::aws_smithy_legacy_http_server::response::Response,
          81  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   82     82   
> {
   83     83   
    Ok({
   84     84   
        #[allow(unused_mut)]
   85     85   
        let mut builder = ::http::Response::builder();
   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::CONTENT_TYPE,
   89     89   
            "application/json",
   90     90   
        );
   91     91   
        let http_status: u16 = 200;
   92     92   
        builder = builder.status(http_status);
   93     93   
        let payload = "";
   94     94   
        let content_length = payload.len();
   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::CONTENT_LENGTH,
   98     98   
            content_length,
   99     99   
        );
  100         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         100  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  101    101   
        builder.body(body)?
  102    102   
    })
  103    103   
}
  104    104   
  105    105   
#[allow(clippy::unnecessary_wraps)]
  106    106   
pub fn ser_malformed_integer_http_error(
  107    107   
    error: &crate::error::MalformedIntegerError,
  108    108   
) -> std::result::Result<
  109         -
    ::aws_smithy_http_server::response::Response,
  110         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         109  +
    ::aws_smithy_legacy_http_server::response::Response,
         110  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  111    111   
> {
  112    112   
    Ok({
  113    113   
        match error {
  114    114   
            crate::error::MalformedIntegerError::ValidationException(output) => {
  115    115   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  116    116   
                #[allow(unused_mut)]
  117    117   
                let mut builder = ::http::Response::builder();
  118         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         118  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  119    119   
                    builder,
  120    120   
                    ::http::header::CONTENT_TYPE,
  121    121   
                    "application/json",
  122    122   
                );
  123         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         123  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  124    124   
                    builder,
  125    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  126    126   
                    "ValidationException",
  127    127   
                );
  128    128   
                let content_length = payload.len();
  129         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         129  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  130    130   
                    builder,
  131    131   
                    ::http::header::CONTENT_LENGTH,
  132    132   
                    content_length,
  133    133   
                );
  134    134   
                builder
  135    135   
                    .status(400)
  136         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         136  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  137    137   
            }
  138    138   
            crate::error::MalformedIntegerError::InternalServerError(output) => {
  139    139   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  140    140   
                #[allow(unused_mut)]
  141    141   
                let mut builder = ::http::Response::builder();
  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_TYPE,
  145    145   
                    "application/json",
  146    146   
                );
  147         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         147  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  148    148   
                    builder,
  149    149   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  150    150   
                    "InternalServerError",
  151    151   
                );
  152    152   
                let content_length = payload.len();
  153         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         153  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  154    154   
                    builder,
  155    155   
                    ::http::header::CONTENT_LENGTH,
  156    156   
                    content_length,
  157    157   
                );
  158    158   
                builder
  159    159   
                    .status(500)
  160         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         160  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  161    161   
            }
  162    162   
        }
  163    163   
    })
  164    164   
}
  165    165   
  166    166   
pub(crate) fn de_malformed_integer(
  167    167   
    value: &[u8],
  168    168   
    mut builder: crate::input::malformed_integer_input_internal::Builder,
  169    169   
) -> ::std::result::Result<
  170    170   
    crate::input::malformed_integer_input_internal::Builder,

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

@@ -1,1 +36,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_integer_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("integerInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
    7      8   
    if var_1.len() > 1 {
    8         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
           9  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
    9     10   
            "expected one item but found {}",
   10     11   
            var_1.len()
   11     12   
        )))
   12     13   
    } else {
   13     14   
        let mut var_1 = var_1;
   14     15   
        Ok(var_1.pop())
   15     16   
    }
   16     17   
}
   17     18   
   18     19   
pub fn de_integer_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    i32,
   22         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          23  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   23     24   
> {
   24     25   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   25     26   
    Ok(value)
   26     27   
}
   27     28   
   28     29   
pub fn de_integer_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<i32>,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          33  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   33     34   
> {
   34     35   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   35     36   
    Ok(Some(value))
   36     37   
}

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

@@ -1,1 +127,127 @@
    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_malformed_list_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedListInput,
    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::malformed_list_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_malformed_list::de_malformed_list(
   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_malformed_list_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::MalformedListOutput,
   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   
        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_malformed_list_http_error(
   68     68   
    error: &crate::error::MalformedListError,
   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::MalformedListError::InternalServerError(output) => {
   76     76   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_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   
                    "InternalServerError",
   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(500)
   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   
        }
  100    100   
    })
  101    101   
}
  102    102   
  103    103   
pub(crate) fn de_malformed_list(
  104    104   
    value: &[u8],
  105    105   
    mut builder: crate::input::malformed_list_input_internal::Builder,
  106    106   
) -> ::std::result::Result<
  107    107   
    crate::input::malformed_list_input_internal::Builder,

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

@@ -1,1 +186,186 @@
    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_malformed_long_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedLongInput,
    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::malformed_long_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_malformed_long::de_malformed_long(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        if let Some(value) =
   34     34   
            crate::protocol_serde::shape_malformed_long_input::de_long_in_header_header(&headers)?
   35     35   
        {
   36     36   
            input = input.set_long_in_header(Some(value))
   37     37   
        }
   38     38   
        let input_string = uri.path();
   39     39   
        let (input_string, (_, m1)) =
   40     40   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   41     41   
                ::nom::sequence::preceded(
   42     42   
                    ::nom::bytes::complete::tag("/"),
   43     43   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("MalformedLong"),
   44     44   
                ),
   45     45   
                ::nom::sequence::preceded(
   46     46   
                    ::nom::bytes::complete::tag("/"),
   47     47   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   48     48   
                        ::nom::bytes::complete::take_until("/"),
   49     49   
                        ::nom::combinator::rest,
   50     50   
                    )),
   51     51   
                ),
   52     52   
            ))(input_string)?;
   53     53   
        debug_assert_eq!("", input_string);
   54     54   
        input = input.set_long_in_path(
   55     55   
            crate::protocol_serde::shape_malformed_long_input::de_long_in_path(m1)?,
   56     56   
        );
   57     57   
        let query_string = uri.query().unwrap_or("");
   58     58   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   59     59   
        let mut long_in_query_seen = false;
   60     60   
        for (k, v) in pairs {
   61     61   
            if !long_in_query_seen && k == "longInQuery" {
   62     62   
                input = input.set_long_in_query(
   63     63   
                    crate::protocol_serde::shape_malformed_long_input::de_long_in_query(&v)?,
   64     64   
                );
   65     65   
                long_in_query_seen = true;
   66     66   
            }
   67     67   
        }
   68     68   
        input.build()?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_malformed_long_http_response(
   74     74   
    #[allow(unused_variables)] output: crate::output::MalformedLongOutput,
   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   
        #[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     87   
        let http_status: u16 = 200;
   88     88   
        builder = builder.status(http_status);
   89     89   
        let payload = "";
   90     90   
        let content_length = payload.len();
   91         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          91  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   92     92   
            builder,
   93     93   
            ::http::header::CONTENT_LENGTH,
   94     94   
            content_length,
   95     95   
        );
   96         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          96  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   97     97   
        builder.body(body)?
   98     98   
    })
   99     99   
}
  100    100   
  101    101   
#[allow(clippy::unnecessary_wraps)]
  102    102   
pub fn ser_malformed_long_http_error(
  103    103   
    error: &crate::error::MalformedLongError,
  104    104   
) -> std::result::Result<
  105         -
    ::aws_smithy_http_server::response::Response,
  106         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         105  +
    ::aws_smithy_legacy_http_server::response::Response,
         106  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  107    107   
> {
  108    108   
    Ok({
  109    109   
        match error {
  110    110   
            crate::error::MalformedLongError::ValidationException(output) => {
  111    111   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  112    112   
                #[allow(unused_mut)]
  113    113   
                let mut builder = ::http::Response::builder();
  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_TYPE,
  117    117   
                    "application/json",
  118    118   
                );
  119         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         119  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  120    120   
                    builder,
  121    121   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  122    122   
                    "ValidationException",
  123    123   
                );
  124    124   
                let content_length = payload.len();
  125         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         125  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  126    126   
                    builder,
  127    127   
                    ::http::header::CONTENT_LENGTH,
  128    128   
                    content_length,
  129    129   
                );
  130    130   
                builder
  131    131   
                    .status(400)
  132         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         132  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  133    133   
            }
  134    134   
            crate::error::MalformedLongError::InternalServerError(output) => {
  135    135   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  136    136   
                #[allow(unused_mut)]
  137    137   
                let mut builder = ::http::Response::builder();
  138         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         138  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  139    139   
                    builder,
  140    140   
                    ::http::header::CONTENT_TYPE,
  141    141   
                    "application/json",
  142    142   
                );
  143         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         143  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  144    144   
                    builder,
  145    145   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  146    146   
                    "InternalServerError",
  147    147   
                );
  148    148   
                let content_length = payload.len();
  149         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         149  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  150    150   
                    builder,
  151    151   
                    ::http::header::CONTENT_LENGTH,
  152    152   
                    content_length,
  153    153   
                );
  154    154   
                builder
  155    155   
                    .status(500)
  156         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         156  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  157    157   
            }
  158    158   
        }
  159    159   
    })
  160    160   
}
  161    161   
  162    162   
pub(crate) fn de_malformed_long(
  163    163   
    value: &[u8],
  164    164   
    mut builder: crate::input::malformed_long_input_internal::Builder,
  165    165   
) -> ::std::result::Result<
  166    166   
    crate::input::malformed_long_input_internal::Builder,

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

@@ -1,1 +36,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_long_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("longInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i64>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<i64>(headers)?;
    7      8   
    if var_1.len() > 1 {
    8         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
           9  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
    9     10   
            "expected one item but found {}",
   10     11   
            var_1.len()
   11     12   
        )))
   12     13   
    } else {
   13     14   
        let mut var_1 = var_1;
   14     15   
        Ok(var_1.pop())
   15     16   
    }
   16     17   
}
   17     18   
   18     19   
pub fn de_long_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    i64,
   22         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          23  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   23     24   
> {
   24     25   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   25     26   
    Ok(value)
   26     27   
}
   27     28   
   28     29   
pub fn de_long_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<i64>,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          33  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   33     34   
> {
   34     35   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   35     36   
    Ok(Some(value))
   36     37   
}

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

@@ -1,1 +127,127 @@
    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_malformed_map_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedMapInput,
    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::malformed_map_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_malformed_map::de_malformed_map(
   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_malformed_map_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::MalformedMapOutput,
   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   
        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_malformed_map_http_error(
   68     68   
    error: &crate::error::MalformedMapError,
   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::MalformedMapError::InternalServerError(output) => {
   76     76   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_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   
                    "InternalServerError",
   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(500)
   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   
        }
  100    100   
    })
  101    101   
}
  102    102   
  103    103   
pub(crate) fn de_malformed_map(
  104    104   
    value: &[u8],
  105    105   
    mut builder: crate::input::malformed_map_input_internal::Builder,
  106    106   
) -> ::std::result::Result<
  107    107   
    crate::input::malformed_map_input_internal::Builder,

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

@@ -1,1 +127,127 @@
    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_malformed_request_body_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedRequestBodyInput,
    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::malformed_request_body_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_malformed_request_body::de_malformed_request_body(
   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_malformed_request_body_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::MalformedRequestBodyOutput,
   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   
        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_malformed_request_body_http_error(
   68     68   
    error: &crate::error::MalformedRequestBodyError,
   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::MalformedRequestBodyError::InternalServerError(output) => {
   76     76   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_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   
                    "InternalServerError",
   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(500)
   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   
        }
  100    100   
    })
  101    101   
}
  102    102   
  103    103   
pub(crate) fn de_malformed_request_body(
  104    104   
    value: &[u8],
  105    105   
    mut builder: crate::input::malformed_request_body_input_internal::Builder,
  106    106   
) -> ::std::result::Result<
  107    107   
    crate::input::malformed_request_body_input_internal::Builder,