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_json_enums.rs

@@ -1,1 +151,151 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_json_enums_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::JsonEnumsInput,
    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::json_enums_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_json_enums::de_json_enums(bytes.as_ref(), input)?;
   29     29   
        }
   30     30   
        input.build()?
   31     31   
    })
   32     32   
}
   33     33   
   34     34   
#[allow(clippy::unnecessary_wraps)]
   35     35   
pub fn ser_json_enums_http_response(
   36     36   
    #[allow(unused_variables)] output: crate::output::JsonEnumsOutput,
   37     37   
) -> std::result::Result<
   38         -
    ::aws_smithy_http_server::response::Response,
   39         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          38  +
    ::aws_smithy_legacy_http_server::response::Response,
          39  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   40     40   
> {
   41     41   
    Ok({
   42     42   
        #[allow(unused_mut)]
   43     43   
        let mut builder = ::http::Response::builder();
   44         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          44  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   45     45   
            builder,
   46     46   
            ::http::header::CONTENT_TYPE,
   47     47   
            "application/json",
   48     48   
        );
   49     49   
        let http_status: u16 = 200;
   50     50   
        builder = builder.status(http_status);
   51     51   
        let payload =
   52     52   
            crate::protocol_serde::shape_json_enums_output::ser_json_enums_output_output_output(
   53     53   
                &output,
   54     54   
            )?;
   55     55   
        let content_length = payload.len();
   56         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          56  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   57     57   
            builder,
   58     58   
            ::http::header::CONTENT_LENGTH,
   59     59   
            content_length,
   60     60   
        );
   61         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          61  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   62     62   
        builder.body(body)?
   63     63   
    })
   64     64   
}
   65     65   
   66     66   
#[allow(clippy::unnecessary_wraps)]
   67     67   
pub fn ser_json_enums_http_error(
   68     68   
    error: &crate::error::JsonEnumsError,
   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::JsonEnumsError::ValidationException(output) => {
   76     76   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   77     77   
                #[allow(unused_mut)]
   78     78   
                let mut builder = ::http::Response::builder();
   79         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   80     80   
                    builder,
   81     81   
                    ::http::header::CONTENT_TYPE,
   82     82   
                    "application/json",
   83     83   
                );
   84         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          84  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   85     85   
                    builder,
   86     86   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   87     87   
                    "ValidationException",
   88     88   
                );
   89     89   
                let content_length = payload.len();
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          90  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   91     91   
                    builder,
   92     92   
                    ::http::header::CONTENT_LENGTH,
   93     93   
                    content_length,
   94     94   
                );
   95     95   
                builder
   96     96   
                    .status(400)
   97         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          97  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   98     98   
            }
   99     99   
            crate::error::JsonEnumsError::InternalServerError(output) => {
  100    100   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  101    101   
                #[allow(unused_mut)]
  102    102   
                let mut builder = ::http::Response::builder();
  103         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         103  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  104    104   
                    builder,
  105    105   
                    ::http::header::CONTENT_TYPE,
  106    106   
                    "application/json",
  107    107   
                );
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         108  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  109    109   
                    builder,
  110    110   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  111    111   
                    "InternalServerError",
  112    112   
                );
  113    113   
                let content_length = payload.len();
  114         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         114  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  115    115   
                    builder,
  116    116   
                    ::http::header::CONTENT_LENGTH,
  117    117   
                    content_length,
  118    118   
                );
  119    119   
                builder
  120    120   
                    .status(500)
  121         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         121  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  122    122   
            }
  123    123   
        }
  124    124   
    })
  125    125   
}
  126    126   
  127    127   
pub(crate) fn de_json_enums(
  128    128   
    value: &[u8],
  129    129   
    mut builder: crate::input::json_enums_input_internal::Builder,
  130    130   
) -> ::std::result::Result<
  131    131   
    crate::input::json_enums_input_internal::Builder,

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

@@ -1,1 +153,153 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_json_int_enums_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::JsonIntEnumsInput,
    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::json_int_enums_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_json_int_enums::de_json_int_enums(
   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_json_int_enums_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::JsonIntEnumsOutput,
   40     40   
) -> std::result::Result<
   41         -
    ::aws_smithy_http_server::response::Response,
   42         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46     46   
        let mut builder = ::http::Response::builder();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49     49   
            ::http::header::CONTENT_TYPE,
   50     50   
            "application/json",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_json_int_enums_output::ser_json_int_enums_output_output_output(&output)?
   56     56   
        ;
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_json_int_enums_http_error(
   70     70   
    error: &crate::error::JsonIntEnumsError,
   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::JsonIntEnumsError::ValidationException(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80     80   
                let mut builder = ::http::Response::builder();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          81  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83     83   
                    ::http::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88     88   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "ValidationException",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(400)
   99         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          99  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
            crate::error::JsonIntEnumsError::InternalServerError(output) => {
  102    102   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  103    103   
                #[allow(unused_mut)]
  104    104   
                let mut builder = ::http::Response::builder();
  105         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         105  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  106    106   
                    builder,
  107    107   
                    ::http::header::CONTENT_TYPE,
  108    108   
                    "application/json",
  109    109   
                );
  110         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         110  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  111    111   
                    builder,
  112    112   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  113    113   
                    "InternalServerError",
  114    114   
                );
  115    115   
                let content_length = payload.len();
  116         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         116  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  117    117   
                    builder,
  118    118   
                    ::http::header::CONTENT_LENGTH,
  119    119   
                    content_length,
  120    120   
                );
  121    121   
                builder
  122    122   
                    .status(500)
  123         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         123  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  124    124   
            }
  125    125   
        }
  126    126   
    })
  127    127   
}
  128    128   
  129    129   
pub(crate) fn de_json_int_enums(
  130    130   
    value: &[u8],
  131    131   
    mut builder: crate::input::json_int_enums_input_internal::Builder,
  132    132   
) -> ::std::result::Result<
  133    133   
    crate::input::json_int_enums_input_internal::Builder,

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

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

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

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

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

@@ -1,1 +129,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_json_timestamps_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::JsonTimestampsInput,
    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::json_timestamps_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_json_timestamps::de_json_timestamps(
   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_json_timestamps_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::JsonTimestampsOutput,
   40     40   
) -> std::result::Result<
   41         -
    ::aws_smithy_http_server::response::Response,
   42         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46     46   
        let mut builder = ::http::Response::builder();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49     49   
            ::http::header::CONTENT_TYPE,
   50     50   
            "application/json",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_json_timestamps_output::ser_json_timestamps_output_output_output(&output)?
   56     56   
        ;
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_json_timestamps_http_error(
   70     70   
    error: &crate::error::JsonTimestampsError,
   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::JsonTimestampsError::InternalServerError(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80     80   
                let mut builder = ::http::Response::builder();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          81  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83     83   
                    ::http::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88     88   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "InternalServerError",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(500)
   99         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          99  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
        }
  102    102   
    })
  103    103   
}
  104    104   
  105    105   
pub(crate) fn de_json_timestamps(
  106    106   
    value: &[u8],
  107    107   
    mut builder: crate::input::json_timestamps_input_internal::Builder,
  108    108   
) -> ::std::result::Result<
  109    109   
    crate::input::json_timestamps_input_internal::Builder,

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

@@ -1,1 +152,152 @@
    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_json_unions_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::JsonUnionsInput,
    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::json_unions_input_internal::Builder::default();
   18     18   
        #[allow(unused_variables)]
   19     19   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     20   
            uri, headers, body, ..
   21     21   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   22     22   
        let bytes = ::hyper::body::to_bytes(body).await?;
   23     23   
        if !bytes.is_empty() {
   24         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          24  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   25     25   
                &headers,
   26     26   
                Some("application/json"),
   27     27   
            )?;
   28     28   
            input =
   29     29   
                crate::protocol_serde::shape_json_unions::de_json_unions(bytes.as_ref(), input)?;
   30     30   
        }
   31     31   
        input.build()?
   32     32   
    })
   33     33   
}
   34     34   
   35     35   
#[allow(clippy::unnecessary_wraps)]
   36     36   
pub fn ser_json_unions_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::JsonUnionsOutput,
   38     38   
) -> std::result::Result<
   39         -
    ::aws_smithy_http_server::response::Response,
   40         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          39  +
    ::aws_smithy_legacy_http_server::response::Response,
          40  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     41   
> {
   42     42   
    Ok({
   43     43   
        #[allow(unused_mut)]
   44     44   
        let mut builder = ::http::Response::builder();
   45         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          45  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47     47   
            ::http::header::CONTENT_TYPE,
   48     48   
            "application/json",
   49     49   
        );
   50     50   
        let http_status: u16 = 200;
   51     51   
        builder = builder.status(http_status);
   52     52   
        let payload =
   53     53   
            crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output_output(
   54     54   
                &output,
   55     55   
            )?;
   56     56   
        let content_length = payload.len();
   57         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          57  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   58     58   
            builder,
   59     59   
            ::http::header::CONTENT_LENGTH,
   60     60   
            content_length,
   61     61   
        );
   62         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          62  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   63     63   
        builder.body(body)?
   64     64   
    })
   65     65   
}
   66     66   
   67     67   
#[allow(clippy::unnecessary_wraps)]
   68     68   
pub fn ser_json_unions_http_error(
   69     69   
    error: &crate::error::JsonUnionsError,
   70     70   
) -> std::result::Result<
   71         -
    ::aws_smithy_http_server::response::Response,
   72         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          71  +
    ::aws_smithy_legacy_http_server::response::Response,
          72  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   73     73   
> {
   74     74   
    Ok({
   75     75   
        match error {
   76     76   
            crate::error::JsonUnionsError::ValidationException(output) => {
   77     77   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   78     78   
                #[allow(unused_mut)]
   79     79   
                let mut builder = ::http::Response::builder();
   80         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          80  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   81     81   
                    builder,
   82     82   
                    ::http::header::CONTENT_TYPE,
   83     83   
                    "application/json",
   84     84   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   88     88   
                    "ValidationException",
   89     89   
                );
   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     96   
                builder
   97     97   
                    .status(400)
   98         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          98  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   99     99   
            }
  100    100   
            crate::error::JsonUnionsError::InternalServerError(output) => {
  101    101   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  102    102   
                #[allow(unused_mut)]
  103    103   
                let mut builder = ::http::Response::builder();
  104         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         104  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  105    105   
                    builder,
  106    106   
                    ::http::header::CONTENT_TYPE,
  107    107   
                    "application/json",
  108    108   
                );
  109         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         109  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  110    110   
                    builder,
  111    111   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  112    112   
                    "InternalServerError",
  113    113   
                );
  114    114   
                let content_length = payload.len();
  115         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         115  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  116    116   
                    builder,
  117    117   
                    ::http::header::CONTENT_LENGTH,
  118    118   
                    content_length,
  119    119   
                );
  120    120   
                builder
  121    121   
                    .status(500)
  122         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         122  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  123    123   
            }
  124    124   
        }
  125    125   
    })
  126    126   
}
  127    127   
  128    128   
pub(crate) fn de_json_unions(
  129    129   
    value: &[u8],
  130    130   
    mut builder: crate::input::json_unions_input_internal::Builder,
  131    131   
) -> ::std::result::Result<
  132    132   
    crate::input::json_unions_input_internal::Builder,

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

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

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

@@ -1,1 +94,96 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_malformed_accept_with_generic_string_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedAcceptWithGenericStringInput,
    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_accept_with_generic_string_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23         -
        ::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_accept_with_generic_string_http_response(
   30     32   
    #[allow(unused_variables)] output: crate::output::MalformedAcceptWithGenericStringOutput,
   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   
            "text/plain",
   42     44   
        );
   43     45   
        let http_status: u16 = 200;
   44     46   
        builder = builder.status(http_status);
   45     47   
        let payload =
   46     48   
            crate::protocol_serde::shape_malformed_accept_with_generic_string_output::ser_payload_http_payload( output.payload)?
   47     49   
        ;
   48     50   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     52   
            builder,
   51     53   
            ::http::header::CONTENT_LENGTH,
   52     54   
            content_length,
   53     55   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     57   
        builder.body(body)?
   56     58   
    })
   57     59   
}
   58     60   
   59     61   
#[allow(clippy::unnecessary_wraps)]
   60     62   
pub fn ser_malformed_accept_with_generic_string_http_error(
   61     63   
    error: &crate::error::MalformedAcceptWithGenericStringError,
   62     64   
) -> std::result::Result<
   63         -
    ::aws_smithy_http_server::response::Response,
   64         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          65  +
    ::aws_smithy_legacy_http_server::response::Response,
          66  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     67   
> {
   66     68   
    Ok({
   67     69   
        match error {
   68     70   
            crate::error::MalformedAcceptWithGenericStringError::InternalServerError(output) => {
   69     71   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   70     72   
                #[allow(unused_mut)]
   71     73   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          74  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     75   
                    builder,
   74     76   
                    ::http::header::CONTENT_TYPE,
   75     77   
                    "text/plain",
   76     78   
                );
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     80   
                    builder,
   79     81   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80     82   
                    "InternalServerError",
   81     83   
                );
   82     84   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     86   
                    builder,
   85     87   
                    ::http::header::CONTENT_LENGTH,
   86     88   
                    content_length,
   87     89   
                );
   88     90   
                builder
   89     91   
                    .status(500)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          92  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     93   
            }
   92     94   
        }
   93     95   
    })
   94     96   
}

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

@@ -1,1 +94,96 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_malformed_accept_with_payload_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedAcceptWithPayloadInput,
    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_accept_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         -
        ::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_accept_with_payload_http_response(
   30     32   
    #[allow(unused_variables)] output: crate::output::MalformedAcceptWithPayloadOutput,
   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   
            "image/jpeg",
   42     44   
        );
   43     45   
        let http_status: u16 = 200;
   44     46   
        builder = builder.status(http_status);
   45     47   
        let payload =
   46     48   
            crate::protocol_serde::shape_malformed_accept_with_payload_output::ser_payload_http_payload( output.payload)?
   47     49   
        ;
   48     50   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     52   
            builder,
   51     53   
            ::http::header::CONTENT_LENGTH,
   52     54   
            content_length,
   53     55   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     57   
        builder.body(body)?
   56     58   
    })
   57     59   
}
   58     60   
   59     61   
#[allow(clippy::unnecessary_wraps)]
   60     62   
pub fn ser_malformed_accept_with_payload_http_error(
   61     63   
    error: &crate::error::MalformedAcceptWithPayloadError,
   62     64   
) -> std::result::Result<
   63         -
    ::aws_smithy_http_server::response::Response,
   64         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          65  +
    ::aws_smithy_legacy_http_server::response::Response,
          66  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     67   
> {
   66     68   
    Ok({
   67     69   
        match error {
   68     70   
            crate::error::MalformedAcceptWithPayloadError::InternalServerError(output) => {
   69     71   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   70     72   
                #[allow(unused_mut)]
   71     73   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          74  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     75   
                    builder,
   74     76   
                    ::http::header::CONTENT_TYPE,
   75     77   
                    "image/jpeg",
   76     78   
                );
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     80   
                    builder,
   79     81   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80     82   
                    "InternalServerError",
   81     83   
                );
   82     84   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     86   
                    builder,
   85     87   
                    ::http::header::CONTENT_LENGTH,
   86     88   
                    content_length,
   87     89   
                );
   88     90   
                builder
   89     91   
                    .status(500)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          92  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     93   
            }
   92     94   
        }
   93     95   
    })
   94     96   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_blob.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_blob_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedBlobInput,
    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_blob_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_blob::de_malformed_blob(
   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_blob_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::MalformedBlobOutput,
   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_blob_http_error(
   68     68   
    error: &crate::error::MalformedBlobError,
   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::MalformedBlobError::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_blob(
  104    104   
    value: &[u8],
  105    105   
    mut builder: crate::input::malformed_blob_input_internal::Builder,
  106    106   
) -> ::std::result::Result<
  107    107   
    crate::input::malformed_blob_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_boolean.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_boolean_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedBooleanInput,
    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_boolean_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_boolean::de_malformed_boolean(
   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_boolean_input::de_boolean_in_header_header(
   35     35   
                &headers,
   36     36   
            )?
   37     37   
        {
   38     38   
            input = input.set_boolean_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   
                        "MalformedBoolean",
   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_boolean_in_path(
   59     59   
            crate::protocol_serde::shape_malformed_boolean_input::de_boolean_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 boolean_in_query_seen = false;
   64     64   
        for (k, v) in pairs {
   65     65   
            if !boolean_in_query_seen && k == "booleanInQuery" {
   66     66   
                input = input.set_boolean_in_query(
   67     67   
                    crate::protocol_serde::shape_malformed_boolean_input::de_boolean_in_query(&v)?,
   68     68   
                );
   69     69   
                boolean_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_boolean_http_response(
   78     78   
    #[allow(unused_variables)] output: crate::output::MalformedBooleanOutput,
   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_boolean_http_error(
  107    107   
    error: &crate::error::MalformedBooleanError,
  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::MalformedBooleanError::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::MalformedBooleanError::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_boolean(
  167    167   
    value: &[u8],
  168    168   
    mut builder: crate::input::malformed_boolean_input_internal::Builder,
  169    169   
) -> ::std::result::Result<
  170    170   
    crate::input::malformed_boolean_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_boolean_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_boolean_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("booleanInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(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_boolean_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    bool,
   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_boolean_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<bool>,
   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_byte.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_byte_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedByteInput,
    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_byte_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_byte::de_malformed_byte(
   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_byte_input::de_byte_in_header_header(&headers)?
   35     35   
        {
   36     36   
            input = input.set_byte_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>>("MalformedByte"),
   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_byte_in_path(
   55     55   
            crate::protocol_serde::shape_malformed_byte_input::de_byte_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 byte_in_query_seen = false;
   60     60   
        for (k, v) in pairs {
   61     61   
            if !byte_in_query_seen && k == "byteInQuery" {
   62     62   
                input = input.set_byte_in_query(
   63     63   
                    crate::protocol_serde::shape_malformed_byte_input::de_byte_in_query(&v)?,
   64     64   
                );
   65     65   
                byte_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_byte_http_response(
   74     74   
    #[allow(unused_variables)] output: crate::output::MalformedByteOutput,
   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_byte_http_error(
  103    103   
    error: &crate::error::MalformedByteError,
  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::MalformedByteError::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::MalformedByteError::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_byte(
  163    163   
    value: &[u8],
  164    164   
    mut builder: crate::input::malformed_byte_input_internal::Builder,
  165    165   
) -> ::std::result::Result<
  166    166   
    crate::input::malformed_byte_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_malformed_byte_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_byte_in_header_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4         -
) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_http::header::ParseError> {
           4  +
) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_legacy_http::header::ParseError>
           5  +
{
    5      6   
    let headers = header_map.get_all("byteInHeader");
    6         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<i8>(headers)?;
           7  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<i8>(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_byte_in_path(
   19     20   
    value: &str,
   20     21   
) -> std::result::Result<
   21     22   
    i8,
   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_byte_in_query(
   29     30   
    value: &str,
   30     31   
) -> std::result::Result<
   31     32   
    ::std::option::Option<i8>,
   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_content_type_with_body.rs

@@ -1,1 +125,125 @@
    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_body_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedContentTypeWithBodyInput,
    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_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     23   
        let bytes = ::hyper::body::to_bytes(body).await?;
   24     24   
        if !bytes.is_empty() {
   25         -
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
            ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   26     26   
                &headers,
   27     27   
                Some("application/json"),
   28     28   
            )?;
   29     29   
            input = crate::protocol_serde::shape_malformed_content_type_with_body::de_malformed_content_type_with_body(bytes.as_ref(), input)?;
   30     30   
        }
   31     31   
        input.build()
   32     32   
    })
   33     33   
}
   34     34   
   35     35   
#[allow(clippy::unnecessary_wraps)]
   36     36   
pub fn ser_malformed_content_type_with_body_http_response(
   37     37   
    #[allow(unused_variables)] output: crate::output::MalformedContentTypeWithBodyOutput,
   38     38   
) -> std::result::Result<
   39         -
    ::aws_smithy_http_server::response::Response,
   40         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          39  +
    ::aws_smithy_legacy_http_server::response::Response,
          40  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   41     41   
> {
   42     42   
    Ok({
   43     43   
        #[allow(unused_mut)]
   44     44   
        let mut builder = ::http::Response::builder();
   45         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          45  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47     47   
            ::http::header::CONTENT_TYPE,
   48     48   
            "application/json",
   49     49   
        );
   50     50   
        let http_status: u16 = 200;
   51     51   
        builder = builder.status(http_status);
   52     52   
        let payload = "";
   53     53   
        let content_length = payload.len();
   54         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   55     55   
            builder,
   56     56   
            ::http::header::CONTENT_LENGTH,
   57     57   
            content_length,
   58     58   
        );
   59         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          59  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   60     60   
        builder.body(body)?
   61     61   
    })
   62     62   
}
   63     63   
   64     64   
#[allow(clippy::unnecessary_wraps)]
   65     65   
pub fn ser_malformed_content_type_with_body_http_error(
   66     66   
    error: &crate::error::MalformedContentTypeWithBodyError,
   67     67   
) -> std::result::Result<
   68         -
    ::aws_smithy_http_server::response::Response,
   69         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   70     70   
> {
   71     71   
    Ok({
   72     72   
        match error {
   73     73   
            crate::error::MalformedContentTypeWithBodyError::InternalServerError(output) => {
   74     74   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   75     75   
                #[allow(unused_mut)]
   76     76   
                let mut builder = ::http::Response::builder();
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          77  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     78   
                    builder,
   79     79   
                    ::http::header::CONTENT_TYPE,
   80     80   
                    "application/json",
   81     81   
                );
   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::HeaderName::from_static("x-amzn-errortype"),
   85     85   
                    "InternalServerError",
   86     86   
                );
   87     87   
                let content_length = payload.len();
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90     90   
                    ::http::header::CONTENT_LENGTH,
   91     91   
                    content_length,
   92     92   
                );
   93     93   
                builder
   94     94   
                    .status(500)
   95         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          95  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   96     96   
            }
   97     97   
        }
   98     98   
    })
   99     99   
}
  100    100   
  101    101   
pub(crate) fn de_malformed_content_type_with_body(
  102    102   
    value: &[u8],
  103    103   
    mut builder: crate::input::malformed_content_type_with_body_input_internal::Builder,
  104    104   
) -> ::std::result::Result<
  105    105   
    crate::input::malformed_content_type_with_body_input_internal::Builder,

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

@@ -1,1 +104,104 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_malformed_content_type_with_generic_string_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MalformedContentTypeWithGenericStringInput,
    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_with_generic_string_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) = {
   23     23   
            let bytes = ::hyper::body::to_bytes(body).await?;
   24     24   
            if !bytes.is_empty() {
   25         -
                ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
          25  +
                ::aws_smithy_legacy_http_server::protocol::content_type_header_classifier_smithy(
   26     26   
                    &headers,
   27     27   
                    Some("text/plain"),
   28     28   
                )?;
   29     29   
            }
   30     30   
            crate::protocol_serde::shape_malformed_content_type_with_generic_string_input::de_payload_payload(&bytes)?
   31     31   
        } {
   32     32   
            input = input.set_payload(Some(value))
   33     33   
        }
   34     34   
        input.build()
   35     35   
    })
   36     36   
}
   37     37   
   38     38   
#[allow(clippy::unnecessary_wraps)]
   39     39   
pub fn ser_malformed_content_type_with_generic_string_http_response(
   40     40   
    #[allow(unused_variables)] output: crate::output::MalformedContentTypeWithGenericStringOutput,
   41     41   
) -> std::result::Result<
   42         -
    ::aws_smithy_http_server::response::Response,
   43         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          42  +
    ::aws_smithy_legacy_http_server::response::Response,
          43  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   44     44   
> {
   45     45   
    Ok({
   46     46   
        #[allow(unused_mut)]
   47     47   
        let mut builder = ::http::Response::builder();
   48         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          48  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   49     49   
            builder,
   50     50   
            ::http::header::CONTENT_TYPE,
   51     51   
            "application/json",
   52     52   
        );
   53     53   
        let http_status: u16 = 200;
   54     54   
        builder = builder.status(http_status);
   55     55   
        let payload = "";
   56     56   
        let content_length = payload.len();
   57         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          57  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   58     58   
            builder,
   59     59   
            ::http::header::CONTENT_LENGTH,
   60     60   
            content_length,
   61     61   
        );
   62         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          62  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   63     63   
        builder.body(body)?
   64     64   
    })
   65     65   
}
   66     66   
   67     67   
#[allow(clippy::unnecessary_wraps)]
   68     68   
pub fn ser_malformed_content_type_with_generic_string_http_error(
   69     69   
    error: &crate::error::MalformedContentTypeWithGenericStringError,
   70     70   
) -> std::result::Result<
   71         -
    ::aws_smithy_http_server::response::Response,
   72         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          71  +
    ::aws_smithy_legacy_http_server::response::Response,
          72  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   73     73   
> {
   74     74   
    Ok({
   75     75   
        match error {
   76     76   
            crate::error::MalformedContentTypeWithGenericStringError::InternalServerError(
   77     77   
                output,
   78     78   
            ) => {
   79     79   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   80     80   
                #[allow(unused_mut)]
   81     81   
                let mut builder = ::http::Response::builder();
   82         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84     84   
                    ::http::header::CONTENT_TYPE,
   85     85   
                    "application/json",
   86     86   
                );
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90     90   
                    "InternalServerError",
   91     91   
                );
   92     92   
                let content_length = payload.len();
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95     95   
                    ::http::header::CONTENT_LENGTH,
   96     96   
                    content_length,
   97     97   
                );
   98     98   
                builder
   99     99   
                    .status(500)
  100         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         100  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  101    101   
            }
  102    102   
        }
  103    103   
    })
  104    104   
}