Server Test Python

Server Test Python

rev. ee474c7509d7728618c23068f3741e8e5b339ef9 (ignoring whitespace)

Files changed:

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

@@ -1,1 +20,20 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_float(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    f32,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
    9      9   
    Ok(value)
   10     10   
}
   11     11   
   12     12   
pub fn de_double(
   13     13   
    value: &str,
   14     14   
) -> std::result::Result<
   15     15   
    f64,
   16         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          16  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   17     17   
> {
   18     18   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   19     19   
    Ok(value)
   20     20   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_http_request_with_greedy_label_in_path.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_http_request_with_greedy_label_in_path_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpRequestWithGreedyLabelInPathInput,
    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::http_request_with_greedy_label_in_path_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 input_string = uri.path();
   24     24   
        let (input_string, (_, _, m2, _, m4)) =
   25     25   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   26     26   
                ::nom::sequence::preceded(
   27     27   
                    ::nom::bytes::complete::tag("/"),
   28     28   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>(
   29     29   
                        "HttpRequestWithGreedyLabelInPath",
   30     30   
                    ),
   31     31   
                ),
   32     32   
                ::nom::sequence::preceded(
   33     33   
                    ::nom::bytes::complete::tag("/"),
   34     34   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("foo"),
   35     35   
                ),
   36     36   
                ::nom::sequence::preceded(
   37     37   
                    ::nom::bytes::complete::tag("/"),
   38     38   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   39     39   
                        ::nom::bytes::complete::take_until("/"),
   40     40   
                        ::nom::combinator::rest,
   41     41   
                    )),
   42     42   
                ),
   43     43   
                ::nom::sequence::preceded(
   44     44   
                    ::nom::bytes::complete::tag("/"),
   45     45   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("baz"),
   46     46   
                ),
   47     47   
                ::nom::sequence::preceded(
   48     48   
                    ::nom::bytes::complete::tag("/"),
   49     49   
                    ::nom::combinator::rest::<_, ::nom::error::Error<&str>>,
   50     50   
                ),
   51     51   
            ))(input_string)?;
   52     52   
        debug_assert_eq!("", input_string);
   53     53   
        input = input.set_foo(
   54     54   
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path_input::de_foo(m2)?,
   55     55   
        );
   56     56   
        input = input.set_baz(
   57     57   
            crate::protocol_serde::shape_http_request_with_greedy_label_in_path_input::de_baz(m4)?,
   58     58   
        );
   59     59   
        input.build()?
   60     60   
    })
   61     61   
}
   62     62   
   63     63   
#[allow(clippy::unnecessary_wraps)]
   64     64   
pub fn ser_http_request_with_greedy_label_in_path_http_response(
   65     65   
    #[allow(unused_variables)] output: crate::output::HttpRequestWithGreedyLabelInPathOutput,
   66     66   
) -> std::result::Result<
   67         -
    ::aws_smithy_http_server::response::Response,
   68         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          67  +
    ::aws_smithy_legacy_http_server::response::Response,
          68  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   69     69   
> {
   70     70   
    Ok({
   71     71   
        #[allow(unused_mut)]
   72     72   
        let mut builder = ::http::Response::builder();
   73         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          73  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   74     74   
            builder,
   75     75   
            ::http::header::CONTENT_TYPE,
   76     76   
            "application/json",
   77     77   
        );
   78     78   
        let http_status: u16 = 200;
   79     79   
        builder = builder.status(http_status);
   80     80   
        let payload = "";
   81     81   
        let content_length = payload.len();
   82         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
            builder,
   84     84   
            ::http::header::CONTENT_LENGTH,
   85     85   
            content_length,
   86     86   
        );
   87         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          87  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   88     88   
        builder.body(body)?
   89     89   
    })
   90     90   
}
   91     91   
   92     92   
#[allow(clippy::unnecessary_wraps)]
   93     93   
pub fn ser_http_request_with_greedy_label_in_path_http_error(
   94     94   
    error: &crate::error::HttpRequestWithGreedyLabelInPathError,
   95     95   
) -> std::result::Result<
   96         -
    ::aws_smithy_http_server::response::Response,
   97         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          96  +
    ::aws_smithy_legacy_http_server::response::Response,
          97  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   98     98   
> {
   99     99   
    Ok({
  100    100   
        match error {
  101    101   
            crate::error::HttpRequestWithGreedyLabelInPathError::ValidationException(output) => {
  102    102   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_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   
                    "ValidationException",
  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(400)
  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   
            crate::error::HttpRequestWithGreedyLabelInPathError::InternalServerError(output) => {
  126    126   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  127    127   
                #[allow(unused_mut)]
  128    128   
                let mut builder = ::http::Response::builder();
  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_TYPE,
  132    132   
                    "application/json",
  133    133   
                );
  134         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         134  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  135    135   
                    builder,
  136    136   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  137    137   
                    "InternalServerError",
  138    138   
                );
  139    139   
                let content_length = payload.len();
  140         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         140  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  141    141   
                    builder,
  142    142   
                    ::http::header::CONTENT_LENGTH,
  143    143   
                    content_length,
  144    144   
                );
  145    145   
                builder
  146    146   
                    .status(500)
  147         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         147  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  148    148   
            }
  149    149   
        }
  150    150   
    })
  151    151   
}

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

@@ -1,1 +24,24 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_foo(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::string::String,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = ::percent_encoding::percent_decode_str(value)
    9      9   
        .decode_utf8()?
   10     10   
        .into_owned();
   11     11   
    Ok(value)
   12     12   
}
   13     13   
   14     14   
pub fn de_baz(
   15     15   
    value: &str,
   16     16   
) -> std::result::Result<
   17     17   
    ::std::string::String,
   18         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          18  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   19     19   
> {
   20     20   
    let value = ::percent_encoding::percent_decode_str(value)
   21     21   
        .decode_utf8()?
   22     22   
        .into_owned();
   23     23   
    Ok(value)
   24     24   
}

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

@@ -1,1 +43,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_http_request_with_labels_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpRequestWithLabelsInput,
    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::http_request_with_labels_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 input_string = uri.path();
   23     23   
        let (input_string, (_, m1, m2, m3, m4, m5, m6, m7, m8)) =
@@ -88,88 +202,202 @@
  108    108   
            crate::protocol_serde::shape_http_request_with_labels_input::de_timestamp(m8)?,
  109    109   
        );
  110    110   
        input.build()?
  111    111   
    })
  112    112   
}
  113    113   
  114    114   
#[allow(clippy::unnecessary_wraps)]
  115    115   
pub fn ser_http_request_with_labels_http_response(
  116    116   
    #[allow(unused_variables)] output: crate::output::HttpRequestWithLabelsOutput,
  117    117   
) -> std::result::Result<
  118         -
    ::aws_smithy_http_server::response::Response,
  119         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         118  +
    ::aws_smithy_legacy_http_server::response::Response,
         119  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  120    120   
> {
  121    121   
    Ok({
  122    122   
        #[allow(unused_mut)]
  123    123   
        let mut builder = ::http::Response::builder();
  124         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         124  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  125    125   
            builder,
  126    126   
            ::http::header::CONTENT_TYPE,
  127    127   
            "application/json",
  128    128   
        );
  129    129   
        let http_status: u16 = 200;
  130    130   
        builder = builder.status(http_status);
  131    131   
        let payload = "";
  132    132   
        let content_length = payload.len();
  133         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         133  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  134    134   
            builder,
  135    135   
            ::http::header::CONTENT_LENGTH,
  136    136   
            content_length,
  137    137   
        );
  138         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         138  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  139    139   
        builder.body(body)?
  140    140   
    })
  141    141   
}
  142    142   
  143    143   
#[allow(clippy::unnecessary_wraps)]
  144    144   
pub fn ser_http_request_with_labels_http_error(
  145    145   
    error: &crate::error::HttpRequestWithLabelsError,
  146    146   
) -> std::result::Result<
  147         -
    ::aws_smithy_http_server::response::Response,
  148         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         147  +
    ::aws_smithy_legacy_http_server::response::Response,
         148  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  149    149   
> {
  150    150   
    Ok({
  151    151   
        match error {
  152    152   
            crate::error::HttpRequestWithLabelsError::ValidationException(output) => {
  153    153   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  154    154   
                #[allow(unused_mut)]
  155    155   
                let mut builder = ::http::Response::builder();
  156         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         156  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  157    157   
                    builder,
  158    158   
                    ::http::header::CONTENT_TYPE,
  159    159   
                    "application/json",
  160    160   
                );
  161         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         161  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  162    162   
                    builder,
  163    163   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  164    164   
                    "ValidationException",
  165    165   
                );
  166    166   
                let content_length = payload.len();
  167         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         167  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  168    168   
                    builder,
  169    169   
                    ::http::header::CONTENT_LENGTH,
  170    170   
                    content_length,
  171    171   
                );
  172    172   
                builder
  173    173   
                    .status(400)
  174         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         174  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  175    175   
            }
  176    176   
            crate::error::HttpRequestWithLabelsError::InternalServerError(output) => {
  177    177   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  178    178   
                #[allow(unused_mut)]
  179    179   
                let mut builder = ::http::Response::builder();
  180         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         180  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  181    181   
                    builder,
  182    182   
                    ::http::header::CONTENT_TYPE,
  183    183   
                    "application/json",
  184    184   
                );
  185         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         185  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  186    186   
                    builder,
  187    187   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  188    188   
                    "InternalServerError",
  189    189   
                );
  190    190   
                let content_length = payload.len();
  191         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         191  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  192    192   
                    builder,
  193    193   
                    ::http::header::CONTENT_LENGTH,
  194    194   
                    content_length,
  195    195   
                );
  196    196   
                builder
  197    197   
                    .status(500)
  198         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         198  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  199    199   
            }
  200    200   
        }
  201    201   
    })
  202    202   
}

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

@@ -1,1 +43,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_http_request_with_labels_and_timestamp_format_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpRequestWithLabelsAndTimestampFormatInput,
    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::http_request_with_labels_and_timestamp_format_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 input_string = uri.path();
   23     23   
        let (input_string, (_, m1, m2, m3, m4, m5, m6, m7)) =
@@ -81,81 +199,199 @@
  101    101   
                                    crate::protocol_serde::shape_http_request_with_labels_and_timestamp_format_input::de_target_date_time(m7)?
  102    102   
                                );
  103    103   
        input.build()?
  104    104   
    })
  105    105   
}
  106    106   
  107    107   
#[allow(clippy::unnecessary_wraps)]
  108    108   
pub fn ser_http_request_with_labels_and_timestamp_format_http_response(
  109    109   
    #[allow(unused_variables)] output: crate::output::HttpRequestWithLabelsAndTimestampFormatOutput,
  110    110   
) -> std::result::Result<
  111         -
    ::aws_smithy_http_server::response::Response,
  112         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         111  +
    ::aws_smithy_legacy_http_server::response::Response,
         112  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  113    113   
> {
  114    114   
    Ok({
  115    115   
        #[allow(unused_mut)]
  116    116   
        let mut builder = ::http::Response::builder();
  117         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
            builder,
  119    119   
            ::http::header::CONTENT_TYPE,
  120    120   
            "application/json",
  121    121   
        );
  122    122   
        let http_status: u16 = 200;
  123    123   
        builder = builder.status(http_status);
  124    124   
        let payload = "";
  125    125   
        let content_length = payload.len();
  126         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  127    127   
            builder,
  128    128   
            ::http::header::CONTENT_LENGTH,
  129    129   
            content_length,
  130    130   
        );
  131         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         131  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  132    132   
        builder.body(body)?
  133    133   
    })
  134    134   
}
  135    135   
  136    136   
#[allow(clippy::unnecessary_wraps)]
  137    137   
pub fn ser_http_request_with_labels_and_timestamp_format_http_error(
  138    138   
    error: &crate::error::HttpRequestWithLabelsAndTimestampFormatError,
  139    139   
) -> std::result::Result<
  140         -
    ::aws_smithy_http_server::response::Response,
  141         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         140  +
    ::aws_smithy_legacy_http_server::response::Response,
         141  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  142    142   
> {
  143    143   
    Ok({
  144    144   
        match error {
  145    145   
            crate::error::HttpRequestWithLabelsAndTimestampFormatError::ValidationException(
  146    146   
                output,
  147    147   
            ) => {
  148    148   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
  149    149   
                #[allow(unused_mut)]
  150    150   
                let mut builder = ::http::Response::builder();
  151         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         151  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  152    152   
                    builder,
  153    153   
                    ::http::header::CONTENT_TYPE,
  154    154   
                    "application/json",
  155    155   
                );
  156         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         156  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  157    157   
                    builder,
  158    158   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  159    159   
                    "ValidationException",
  160    160   
                );
  161    161   
                let content_length = payload.len();
  162         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         162  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  163    163   
                    builder,
  164    164   
                    ::http::header::CONTENT_LENGTH,
  165    165   
                    content_length,
  166    166   
                );
  167    167   
                builder
  168    168   
                    .status(400)
  169         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         169  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  170    170   
            }
  171    171   
            crate::error::HttpRequestWithLabelsAndTimestampFormatError::InternalServerError(
  172    172   
                output,
  173    173   
            ) => {
  174    174   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  175    175   
                #[allow(unused_mut)]
  176    176   
                let mut builder = ::http::Response::builder();
  177         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         177  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  178    178   
                    builder,
  179    179   
                    ::http::header::CONTENT_TYPE,
  180    180   
                    "application/json",
  181    181   
                );
  182         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         182  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  183    183   
                    builder,
  184    184   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  185    185   
                    "InternalServerError",
  186    186   
                );
  187    187   
                let content_length = payload.len();
  188         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         188  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  189    189   
                    builder,
  190    190   
                    ::http::header::CONTENT_LENGTH,
  191    191   
                    content_length,
  192    192   
                );
  193    193   
                builder
  194    194   
                    .status(500)
  195         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         195  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  196    196   
            }
  197    197   
        }
  198    198   
    })
  199    199   
}

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

@@ -1,1 +105,105 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_member_epoch_seconds(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::aws_smithy_http_server_python::types::DateTime,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
    9      9   
    let value = ::aws_smithy_types::DateTime::from_str(
   10     10   
        value.as_ref(),
   11     11   
        ::aws_smithy_types::date_time::Format::EpochSeconds,
   12     12   
    )?
   13     13   
    .into();
   14     14   
    Ok(value)
   15     15   
}
   16     16   
   17     17   
pub fn de_member_http_date(
   18     18   
    value: &str,
   19     19   
) -> std::result::Result<
   20     20   
    ::aws_smithy_http_server_python::types::DateTime,
   21         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          21  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   22     22   
> {
   23     23   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   24     24   
    let value = ::aws_smithy_types::DateTime::from_str(
   25     25   
        value.as_ref(),
   26     26   
        ::aws_smithy_types::date_time::Format::HttpDate,
   27     27   
    )?
   28     28   
    .into();
   29     29   
    Ok(value)
   30     30   
}
   31     31   
   32     32   
pub fn de_member_date_time(
   33     33   
    value: &str,
   34     34   
) -> std::result::Result<
   35     35   
    ::aws_smithy_http_server_python::types::DateTime,
   36         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          36  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   37     37   
> {
   38     38   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   39     39   
    let value = ::aws_smithy_types::DateTime::from_str(
   40     40   
        value.as_ref(),
   41     41   
        ::aws_smithy_types::date_time::Format::DateTime,
   42     42   
    )?
   43     43   
    .into();
   44     44   
    Ok(value)
   45     45   
}
   46     46   
   47     47   
pub fn de_default_format(
   48     48   
    value: &str,
   49     49   
) -> std::result::Result<
   50     50   
    ::aws_smithy_http_server_python::types::DateTime,
   51         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          51  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   52     52   
> {
   53     53   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   54     54   
    let value = ::aws_smithy_types::DateTime::from_str(
   55     55   
        value.as_ref(),
   56     56   
        ::aws_smithy_types::date_time::Format::DateTime,
   57     57   
    )?
   58     58   
    .into();
   59     59   
    Ok(value)
   60     60   
}
   61     61   
   62     62   
pub fn de_target_epoch_seconds(
   63     63   
    value: &str,
   64     64   
) -> std::result::Result<
   65     65   
    ::aws_smithy_http_server_python::types::DateTime,
   66         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          66  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   67     67   
> {
   68     68   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   69     69   
    let value = ::aws_smithy_types::DateTime::from_str(
   70     70   
        value.as_ref(),
   71     71   
        ::aws_smithy_types::date_time::Format::EpochSeconds,
   72     72   
    )?
   73     73   
    .into();
   74     74   
    Ok(value)
   75     75   
}
   76     76   
   77     77   
pub fn de_target_http_date(
   78     78   
    value: &str,
   79     79   
) -> std::result::Result<
   80     80   
    ::aws_smithy_http_server_python::types::DateTime,
   81         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          81  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   82     82   
> {
   83     83   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   84     84   
    let value = ::aws_smithy_types::DateTime::from_str(
   85     85   
        value.as_ref(),
   86     86   
        ::aws_smithy_types::date_time::Format::HttpDate,
   87     87   
    )?
   88     88   
    .into();
   89     89   
    Ok(value)
   90     90   
}
   91     91   
   92     92   
pub fn de_target_date_time(
   93     93   
    value: &str,
   94     94   
) -> std::result::Result<
   95     95   
    ::aws_smithy_http_server_python::types::DateTime,
   96         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          96  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   97     97   
> {
   98     98   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   99     99   
    let value = ::aws_smithy_types::DateTime::from_str(
  100    100   
        value.as_ref(),
  101    101   
        ::aws_smithy_types::date_time::Format::DateTime,
  102    102   
    )?
  103    103   
    .into();
  104    104   
    Ok(value)
  105    105   
}

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

@@ -1,1 +87,87 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub fn de_string(
    3      3   
    value: &str,
    4      4   
) -> std::result::Result<
    5      5   
    ::std::string::String,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    let value = ::percent_encoding::percent_decode_str(value)
    9      9   
        .decode_utf8()?
   10     10   
        .into_owned();
   11     11   
    Ok(value)
   12     12   
}
   13     13   
   14     14   
pub fn de_short(
   15     15   
    value: &str,
   16     16   
) -> std::result::Result<
   17     17   
    i16,
   18         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          18  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   19     19   
> {
   20     20   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   21     21   
    Ok(value)
   22     22   
}
   23     23   
   24     24   
pub fn de_integer(
   25     25   
    value: &str,
   26     26   
) -> std::result::Result<
   27     27   
    i32,
   28         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          28  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   29     29   
> {
   30     30   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   31     31   
    Ok(value)
   32     32   
}
   33     33   
   34     34   
pub fn de_long(
   35     35   
    value: &str,
   36     36   
) -> std::result::Result<
   37     37   
    i64,
   38         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          38  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   39     39   
> {
   40     40   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   41     41   
    Ok(value)
   42     42   
}
   43     43   
   44     44   
pub fn de_float(
   45     45   
    value: &str,
   46     46   
) -> std::result::Result<
   47     47   
    f32,
   48         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          48  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   49     49   
> {
   50     50   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   51     51   
    Ok(value)
   52     52   
}
   53     53   
   54     54   
pub fn de_double(
   55     55   
    value: &str,
   56     56   
) -> std::result::Result<
   57     57   
    f64,
   58         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          58  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   59     59   
> {
   60     60   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   61     61   
    Ok(value)
   62     62   
}
   63     63   
   64     64   
pub fn de_boolean(
   65     65   
    value: &str,
   66     66   
) -> std::result::Result<
   67     67   
    bool,
   68         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          68  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   69     69   
> {
   70     70   
    let value = <_ as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive(value)?;
   71     71   
    Ok(value)
   72     72   
}
   73     73   
   74     74   
pub fn de_timestamp(
   75     75   
    value: &str,
   76     76   
) -> std::result::Result<
   77     77   
    ::aws_smithy_http_server_python::types::DateTime,
   78         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
          78  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
   79     79   
> {
   80     80   
    let value = ::percent_encoding::percent_decode_str(value).decode_utf8()?;
   81     81   
    let value = ::aws_smithy_types::DateTime::from_str(
   82     82   
        value.as_ref(),
   83     83   
        ::aws_smithy_types::date_time::Format::DateTime,
   84     84   
    )?
   85     85   
    .into();
   86     86   
    Ok(value)
   87     87   
}

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

@@ -1,1 +138,138 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_http_request_with_regex_literal_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpRequestWithRegexLiteralInput,
    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::http_request_with_regex_literal_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 input_string = uri.path();
   24     24   
        let (input_string, (_, m1, _)) =
   25     25   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   26     26   
                ::nom::sequence::preceded(
   27     27   
                    ::nom::bytes::complete::tag("/"),
   28     28   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("ReDosLiteral"),
   29     29   
                ),
   30     30   
                ::nom::sequence::preceded(
   31     31   
                    ::nom::bytes::complete::tag("/"),
   32     32   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   33     33   
                        ::nom::bytes::complete::take_until("/"),
   34     34   
                        ::nom::combinator::rest,
   35     35   
                    )),
   36     36   
                ),
   37     37   
                ::nom::sequence::preceded(
   38     38   
                    ::nom::bytes::complete::tag("/"),
   39     39   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("(a+)+"),
   40     40   
                ),
   41     41   
            ))(input_string)?;
   42     42   
        debug_assert_eq!("", input_string);
   43     43   
        input = input.set_str(
   44     44   
            crate::protocol_serde::shape_http_request_with_regex_literal_input::de_str(m1)?,
   45     45   
        );
   46     46   
        input.build()?
   47     47   
    })
   48     48   
}
   49     49   
   50     50   
#[allow(clippy::unnecessary_wraps)]
   51     51   
pub fn ser_http_request_with_regex_literal_http_response(
   52     52   
    #[allow(unused_variables)] output: crate::output::HttpRequestWithRegexLiteralOutput,
   53     53   
) -> std::result::Result<
   54         -
    ::aws_smithy_http_server::response::Response,
   55         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          54  +
    ::aws_smithy_legacy_http_server::response::Response,
          55  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   56     56   
> {
   57     57   
    Ok({
   58     58   
        #[allow(unused_mut)]
   59     59   
        let mut builder = ::http::Response::builder();
   60         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          60  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   61     61   
            builder,
   62     62   
            ::http::header::CONTENT_TYPE,
   63     63   
            "application/json",
   64     64   
        );
   65     65   
        let http_status: u16 = 200;
   66     66   
        builder = builder.status(http_status);
   67     67   
        let payload = "";
   68     68   
        let content_length = payload.len();
   69         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          69  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   70     70   
            builder,
   71     71   
            ::http::header::CONTENT_LENGTH,
   72     72   
            content_length,
   73     73   
        );
   74         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          74  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   75     75   
        builder.body(body)?
   76     76   
    })
   77     77   
}
   78     78   
   79     79   
#[allow(clippy::unnecessary_wraps)]
   80     80   
pub fn ser_http_request_with_regex_literal_http_error(
   81     81   
    error: &crate::error::HttpRequestWithRegexLiteralError,
   82     82   
) -> std::result::Result<
   83         -
    ::aws_smithy_http_server::response::Response,
   84         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          83  +
    ::aws_smithy_legacy_http_server::response::Response,
          84  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   85     85   
> {
   86     86   
    Ok({
   87     87   
        match error {
   88     88   
            crate::error::HttpRequestWithRegexLiteralError::ValidationException(output) => {
   89     89   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   90     90   
                #[allow(unused_mut)]
   91     91   
                let mut builder = ::http::Response::builder();
   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_TYPE,
   95     95   
                    "application/json",
   96     96   
                );
   97         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          97  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   98     98   
                    builder,
   99     99   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  100    100   
                    "ValidationException",
  101    101   
                );
  102    102   
                let content_length = payload.len();
  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_LENGTH,
  106    106   
                    content_length,
  107    107   
                );
  108    108   
                builder
  109    109   
                    .status(400)
  110         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         110  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  111    111   
            }
  112    112   
            crate::error::HttpRequestWithRegexLiteralError::InternalServerError(output) => {
  113    113   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  114    114   
                #[allow(unused_mut)]
  115    115   
                let mut builder = ::http::Response::builder();
  116         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         116  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  117    117   
                    builder,
  118    118   
                    ::http::header::CONTENT_TYPE,
  119    119   
                    "application/json",
  120    120   
                );
  121         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         121  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  122    122   
                    builder,
  123    123   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  124    124   
                    "InternalServerError",
  125    125   
                );
  126    126   
                let content_length = payload.len();
  127         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         127  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  128    128   
                    builder,
  129    129   
                    ::http::header::CONTENT_LENGTH,
  130    130   
                    content_length,
  131    131   
                );
  132    132   
                builder
  133    133   
                    .status(500)
  134         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         134  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  135    135   
            }
  136    136   
        }
  137    137   
    })
  138    138   
}

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

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

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_http_response_code.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_http_response_code_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpResponseCodeInput,
    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::http_response_code_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_http_response_code_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::HttpResponseCodeOutput,
   30     32   
) -> std::result::Result<
   31         -
    ::aws_smithy_http_server::response::Response,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     35   
> {
   34     36   
    Ok({
   35     37   
        #[allow(unused_mut)]
   36     38   
        let mut builder = ::http::Response::builder();
   37         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          39  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   38     40   
            builder,
   39     41   
            ::http::header::CONTENT_TYPE,
   40     42   
            "application/json",
   41     43   
        );
   42     44   
        let status = output.status.unwrap_or(200);
   43         -
        let http_status: u16 = status.try_into().map_err(::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
          45  +
        let http_status: u16 = status.try_into().map_err(::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection::InvalidHttpStatusCode)?;
   44     46   
        builder = builder.status(http_status);
   45     47   
        let payload =
   46     48   
            crate::protocol_serde::shape_http_response_code_output::ser_http_response_code_output_output_output(&output)?
   47     49   
        ;
   48     50   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     52   
            builder,
   51     53   
            ::http::header::CONTENT_LENGTH,
   52     54   
            content_length,
   53     55   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     57   
        builder.body(body)?
   56     58   
    })
   57     59   
}
   58     60   
   59     61   
#[allow(clippy::unnecessary_wraps)]
   60     62   
pub fn ser_http_response_code_http_error(
   61     63   
    error: &crate::error::HttpResponseCodeError,
   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::HttpResponseCodeError::InternalServerError(output) => {
   69     71   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   70     72   
                #[allow(unused_mut)]
   71     73   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          74  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     75   
                    builder,
   74     76   
                    ::http::header::CONTENT_TYPE,
   75     77   
                    "application/json",
   76     78   
                );
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     80   
                    builder,
   79     81   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80     82   
                    "InternalServerError",
   81     83   
                );
   82     84   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     86   
                    builder,
   85     87   
                    ::http::header::CONTENT_LENGTH,
   86     88   
                    content_length,
   87     89   
                );
   88     90   
                builder
   89     91   
                    .status(500)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          92  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     93   
            }
   92     94   
        }
   93     95   
    })
   94     96   
}

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

@@ -1,1 +105,105 @@
    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_http_string_payload_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpStringPayloadInput,
    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::http_string_payload_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_http_string_payload_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_http_string_payload_http_response(
   40     40   
    #[allow(unused_variables)] output: crate::output::HttpStringPayloadOutput,
   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   
            "text/plain",
   52     52   
        );
   53     53   
        let http_status: u16 = 200;
   54     54   
        builder = builder.status(http_status);
   55     55   
        let payload =
   56     56   
            crate::protocol_serde::shape_http_string_payload_output::ser_payload_http_payload(
   57     57   
                output.payload,
   58     58   
            )?;
   59     59   
        let content_length = payload.len();
   60         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          60  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   61     61   
            builder,
   62     62   
            ::http::header::CONTENT_LENGTH,
   63     63   
            content_length,
   64     64   
        );
   65         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          65  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   66     66   
        builder.body(body)?
   67     67   
    })
   68     68   
}
   69     69   
   70     70   
#[allow(clippy::unnecessary_wraps)]
   71     71   
pub fn ser_http_string_payload_http_error(
   72     72   
    error: &crate::error::HttpStringPayloadError,
   73     73   
) -> std::result::Result<
   74         -
    ::aws_smithy_http_server::response::Response,
   75         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          74  +
    ::aws_smithy_legacy_http_server::response::Response,
          75  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   76     76   
> {
   77     77   
    Ok({
   78     78   
        match error {
   79     79   
            crate::error::HttpStringPayloadError::InternalServerError(output) => {
   80     80   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   81     81   
                #[allow(unused_mut)]
   82     82   
                let mut builder = ::http::Response::builder();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     84   
                    builder,
   85     85   
                    ::http::header::CONTENT_TYPE,
   86     86   
                    "text/plain",
   87     87   
                );
   88         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   89     89   
                    builder,
   90     90   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   91     91   
                    "InternalServerError",
   92     92   
                );
   93     93   
                let content_length = payload.len();
   94         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          94  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   95     95   
                    builder,
   96     96   
                    ::http::header::CONTENT_LENGTH,
   97     97   
                    content_length,
   98     98   
                );
   99     99   
                builder
  100    100   
                    .status(500)
  101         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         101  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  102    102   
            }
  103    103   
        }
  104    104   
    })
  105    105   
}

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

@@ -1,1 +14,14 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_payload_payload(
    3      3   
    body: &[u8],
    4      4   
) -> std::result::Result<
    5      5   
    ::std::option::Option<::std::string::String>,
    6         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
           6  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      7   
> {
    8      8   
    (!body.is_empty())
    9      9   
        .then(|| {
   10     10   
            let body_str = std::str::from_utf8(body)?;
   11     11   
            Ok(body_str.to_string())
   12     12   
        })
   13     13   
        .transpose()
   14     14   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_ignore_query_params_in_response.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_ignore_query_params_in_response_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::IgnoreQueryParamsInResponseInput,
    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::ignore_query_params_in_response_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_ignore_query_params_in_response_http_response(
   30     32   
    #[allow(unused_variables)] output: crate::output::IgnoreQueryParamsInResponseOutput,
   31     33   
) -> std::result::Result<
   32         -
    ::aws_smithy_http_server::response::Response,
   33         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          34  +
    ::aws_smithy_legacy_http_server::response::Response,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   34     36   
> {
   35     37   
    Ok({
   36     38   
        #[allow(unused_mut)]
   37     39   
        let mut builder = ::http::Response::builder();
   38         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          40  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   39     41   
            builder,
   40     42   
            ::http::header::CONTENT_TYPE,
   41     43   
            "application/json",
   42     44   
        );
   43     45   
        let http_status: u16 = 200;
   44     46   
        builder = builder.status(http_status);
   45     47   
        let payload =
   46     48   
            crate::protocol_serde::shape_ignore_query_params_in_response_output::ser_ignore_query_params_in_response_output_output_output(&output)?
   47     49   
        ;
   48     50   
        let content_length = payload.len();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          51  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     52   
            builder,
   51     53   
            ::http::header::CONTENT_LENGTH,
   52     54   
            content_length,
   53     55   
        );
   54         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          56  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   55     57   
        builder.body(body)?
   56     58   
    })
   57     59   
}
   58     60   
   59     61   
#[allow(clippy::unnecessary_wraps)]
   60     62   
pub fn ser_ignore_query_params_in_response_http_error(
   61     63   
    error: &crate::error::IgnoreQueryParamsInResponseError,
   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::IgnoreQueryParamsInResponseError::InternalServerError(output) => {
   69     71   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   70     72   
                #[allow(unused_mut)]
   71     73   
                let mut builder = ::http::Response::builder();
   72         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          74  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   73     75   
                    builder,
   74     76   
                    ::http::header::CONTENT_TYPE,
   75     77   
                    "application/json",
   76     78   
                );
   77         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          79  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   78     80   
                    builder,
   79     81   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80     82   
                    "InternalServerError",
   81     83   
                );
   82     84   
                let content_length = payload.len();
   83         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   84     86   
                    builder,
   85     87   
                    ::http::header::CONTENT_LENGTH,
   86     88   
                    content_length,
   87     89   
                );
   88     90   
                builder
   89     91   
                    .status(500)
   90         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          92  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   91     93   
            }
   92     94   
        }
   93     95   
    })
   94     96   
}

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

@@ -1,1 +43,43 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_input_and_output_with_headers_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::InputAndOutputWithHeadersInput,
    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::input_and_output_with_headers_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        if let Some(value) = crate::protocol_serde::shape_input_and_output_with_headers_input::de_header_boolean_list_header(&headers)? {
@@ -67,67 +210,210 @@
   87     87   
                                input = input.set_header_true_bool(Some(value))
   88     88   
                            }
   89     89   
        input.build()?
   90     90   
    })
   91     91   
}
   92     92   
   93     93   
#[allow(clippy::unnecessary_wraps)]
   94     94   
pub fn ser_input_and_output_with_headers_http_response(
   95     95   
    #[allow(unused_variables)] output: crate::output::InputAndOutputWithHeadersOutput,
   96     96   
) -> std::result::Result<
   97         -
    ::aws_smithy_http_server::response::Response,
   98         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          97  +
    ::aws_smithy_legacy_http_server::response::Response,
          98  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   99     99   
> {
  100    100   
    Ok({
  101    101   
        #[allow(unused_mut)]
  102    102   
        let mut builder = ::http::Response::builder();
  103    103   
        builder = crate::protocol_serde::shape_input_and_output_with_headers::ser_input_and_output_with_headers_headers(&output, 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    109   
        let http_status: u16 = 200;
  110    110   
        builder = builder.status(http_status);
  111    111   
        let payload =
  112    112   
            crate::protocol_serde::shape_input_and_output_with_headers_output::ser_input_and_output_with_headers_output_output_output(&output)?
  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         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
         120  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
  121    121   
        builder.body(body)?
  122    122   
    })
  123    123   
}
  124    124   
  125    125   
#[allow(clippy::unnecessary_wraps)]
  126    126   
pub fn ser_input_and_output_with_headers_http_error(
  127    127   
    error: &crate::error::InputAndOutputWithHeadersError,
  128    128   
) -> std::result::Result<
  129         -
    ::aws_smithy_http_server::response::Response,
  130         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
         129  +
    ::aws_smithy_legacy_http_server::response::Response,
         130  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
  131    131   
> {
  132    132   
    Ok({
  133    133   
        match error {
  134    134   
            crate::error::InputAndOutputWithHeadersError::ValidationException(output) => {
  135    135   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_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   
                    "ValidationException",
  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(400)
  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   
            crate::error::InputAndOutputWithHeadersError::InternalServerError(output) => {
  159    159   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  160    160   
                #[allow(unused_mut)]
  161    161   
                let mut builder = ::http::Response::builder();
  162         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         162  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  163    163   
                    builder,
  164    164   
                    ::http::header::CONTENT_TYPE,
  165    165   
                    "application/json",
  166    166   
                );
  167         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         167  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  168    168   
                    builder,
  169    169   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  170    170   
                    "InternalServerError",
  171    171   
                );
  172    172   
                let content_length = payload.len();
  173         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         173  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  174    174   
                    builder,
  175    175   
                    ::http::header::CONTENT_LENGTH,
  176    176   
                    content_length,
  177    177   
                );
  178    178   
                builder
  179    179   
                    .status(500)
  180         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         180  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  181    181   
            }
  182    182   
        }
  183    183   
    })
  184    184   
}
  185    185   
  186    186   
pub fn ser_input_and_output_with_headers_headers(
  187    187   
    input: &crate::output::InputAndOutputWithHeadersOutput,
  188    188   
    mut builder: ::http::response::Builder,
  189    189   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  190    190   
{
@@ -315,315 +393,395 @@
  335    335   
                        "`{}` cannot be used as a header value: {}",
  336    336   
                        &header_value, err
  337    337   
                    ),
  338    338   
                )
  339    339   
            })?;
  340    340   
            builder = builder.header("X-Boolean2", header_value);
  341    341   
        }
  342    342   
    }
  343    343   
    if let ::std::option::Option::Some(inner_19) = &input.header_string_list {
  344    344   
        for inner_20 in inner_19 {
  345         -
            let formatted_21 = ::aws_smithy_http::header::quote_header_value(inner_20.as_str());
         345  +
            let formatted_21 =
         346  +
                ::aws_smithy_legacy_http::header::quote_header_value(inner_20.as_str());
  346    347   
            if !formatted_21.is_empty() {
  347    348   
                let header_value = formatted_21;
  348    349   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  349    350   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  350    351   
                        "header_string_list",
  351    352   
                        format!(
  352    353   
                            "`{}` cannot be used as a header value: {}",
  353    354   
                            &header_value, err
  354    355   
                        ),
  355    356   
                    )
  356    357   
                })?;
  357    358   
                builder = builder.header("X-StringList", header_value);
  358    359   
            }
  359    360   
        }
  360    361   
    }
  361    362   
    if let ::std::option::Option::Some(inner_22) = &input.header_string_set {
  362    363   
        for inner_23 in inner_22 {
  363         -
            let formatted_24 = ::aws_smithy_http::header::quote_header_value(inner_23.as_str());
         364  +
            let formatted_24 =
         365  +
                ::aws_smithy_legacy_http::header::quote_header_value(inner_23.as_str());
  364    366   
            if !formatted_24.is_empty() {
  365    367   
                let header_value = formatted_24;
  366    368   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  367    369   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  368    370   
                        "header_string_set",
  369    371   
                        format!(
  370    372   
                            "`{}` cannot be used as a header value: {}",
  371    373   
                            &header_value, err
  372    374   
                        ),
  373    375   
                    )
@@ -423,425 +483,486 @@
  443    445   
                        "`{}` cannot be used as a header value: {}",
  444    446   
                        &header_value, err
  445    447   
                    ),
  446    448   
                )
  447    449   
            })?;
  448    450   
            builder = builder.header("X-Enum", header_value);
  449    451   
        }
  450    452   
    }
  451    453   
    if let ::std::option::Option::Some(inner_36) = &input.header_enum_list {
  452    454   
        for inner_37 in inner_36 {
  453         -
            let formatted_38 = ::aws_smithy_http::header::quote_header_value(inner_37.as_str());
         455  +
            let formatted_38 =
         456  +
                ::aws_smithy_legacy_http::header::quote_header_value(inner_37.as_str());
  454    457   
            if !formatted_38.is_empty() {
  455    458   
                let header_value = formatted_38;
  456    459   
                let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
  457    460   
                    ::aws_smithy_types::error::operation::BuildError::invalid_field(
  458    461   
                        "header_enum_list",
  459    462   
                        format!(
  460    463   
                            "`{}` cannot be used as a header value: {}",
  461    464   
                            &header_value, err
  462    465   
                        ),
  463    466   
                    )

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

@@ -1,1 +272,282 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
pub(crate) fn de_header_boolean_list_header(
    3      3   
    header_map: &::aws_smithy_runtime_api::http::Headers,
    4      4   
) -> ::std::result::Result<
    5      5   
    ::std::option::Option<::std::vec::Vec<bool>>,
    6         -
    ::aws_smithy_http::header::ParseError,
           6  +
    ::aws_smithy_legacy_http::header::ParseError,
    7      7   
> {
    8      8   
    let headers = header_map.get_all("X-BooleanList");
    9         -
    let var_1 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
           9  +
    let var_1 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(headers)?;
   10     10   
    Ok(if !var_1.is_empty() { Some(var_1) } else { None })
   11     11   
}
   12     12   
   13     13   
pub(crate) fn de_header_byte_header(
   14     14   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   15         -
) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_http::header::ParseError> {
          15  +
) -> ::std::result::Result<::std::option::Option<i8>, ::aws_smithy_legacy_http::header::ParseError>
          16  +
{
   16     17   
    let headers = header_map.get_all("X-Byte");
   17         -
    let var_2 = ::aws_smithy_http::header::read_many_primitive::<i8>(headers)?;
          18  +
    let var_2 = ::aws_smithy_legacy_http::header::read_many_primitive::<i8>(headers)?;
   18     19   
    if var_2.len() > 1 {
   19         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          20  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   20     21   
            "expected one item but found {}",
   21     22   
            var_2.len()
   22     23   
        )))
   23     24   
    } else {
   24     25   
        let mut var_2 = var_2;
   25     26   
        Ok(var_2.pop())
   26     27   
    }
   27     28   
}
   28     29   
   29     30   
pub(crate) fn de_header_double_header(
   30     31   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   31         -
) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_http::header::ParseError> {
          32  +
) -> ::std::result::Result<::std::option::Option<f64>, ::aws_smithy_legacy_http::header::ParseError>
          33  +
{
   32     34   
    let headers = header_map.get_all("X-Double");
   33         -
    let var_3 = ::aws_smithy_http::header::read_many_primitive::<f64>(headers)?;
          35  +
    let var_3 = ::aws_smithy_legacy_http::header::read_many_primitive::<f64>(headers)?;
   34     36   
    if var_3.len() > 1 {
   35         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          37  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   36     38   
            "expected one item but found {}",
   37     39   
            var_3.len()
   38     40   
        )))
   39     41   
    } else {
   40     42   
        let mut var_3 = var_3;
   41     43   
        Ok(var_3.pop())
   42     44   
    }
   43     45   
}
   44     46   
   45     47   
pub(crate) fn de_header_enum_header(
   46     48   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   47     49   
) -> ::std::result::Result<
   48     50   
    ::std::option::Option<::std::string::String>,
   49         -
    ::aws_smithy_http::header::ParseError,
          51  +
    ::aws_smithy_legacy_http::header::ParseError,
   50     52   
> {
   51     53   
    let headers = header_map.get_all("X-Enum");
   52         -
    ::aws_smithy_http::header::one_or_none(headers)
          54  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
   53     55   
}
   54     56   
   55     57   
pub(crate) fn de_header_enum_list_header(
   56     58   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   57     59   
) -> ::std::result::Result<
   58     60   
    ::std::option::Option<
   59     61   
        crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained,
   60     62   
    >,
   61         -
    ::aws_smithy_http::header::ParseError,
          63  +
    ::aws_smithy_legacy_http::header::ParseError,
   62     64   
> {
   63     65   
    let headers = header_map.get_all("X-EnumList");
   64         -
    let var_4: Vec<::std::string::String> = ::aws_smithy_http::header::read_many_from_str(headers)?;
          66  +
    let var_4: Vec<::std::string::String> =
          67  +
        ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
   65     68   
    Ok(if !var_4.is_empty() {
   66     69   
        Some(crate::unconstrained::foo_enum_list_unconstrained::FooEnumListUnconstrained(var_4))
   67     70   
    } else {
   68     71   
        None
   69     72   
    })
   70     73   
}
   71     74   
   72     75   
pub(crate) fn de_header_false_bool_header(
   73     76   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   74         -
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
          77  +
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_legacy_http::header::ParseError>
          78  +
{
   75     79   
    let headers = header_map.get_all("X-Boolean2");
   76         -
    let var_5 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
          80  +
    let var_5 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(headers)?;
   77     81   
    if var_5.len() > 1 {
   78         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          82  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   79     83   
            "expected one item but found {}",
   80     84   
            var_5.len()
   81     85   
        )))
   82     86   
    } else {
   83     87   
        let mut var_5 = var_5;
   84     88   
        Ok(var_5.pop())
   85     89   
    }
   86     90   
}
   87     91   
   88     92   
pub(crate) fn de_header_float_header(
   89     93   
    header_map: &::aws_smithy_runtime_api::http::Headers,
   90         -
) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_http::header::ParseError> {
          94  +
) -> ::std::result::Result<::std::option::Option<f32>, ::aws_smithy_legacy_http::header::ParseError>
          95  +
{
   91     96   
    let headers = header_map.get_all("X-Float");
   92         -
    let var_6 = ::aws_smithy_http::header::read_many_primitive::<f32>(headers)?;
          97  +
    let var_6 = ::aws_smithy_legacy_http::header::read_many_primitive::<f32>(headers)?;
   93     98   
    if var_6.len() > 1 {
   94         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
          99  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
   95    100   
            "expected one item but found {}",
   96    101   
            var_6.len()
   97    102   
        )))
   98    103   
    } else {
   99    104   
        let mut var_6 = var_6;
  100    105   
        Ok(var_6.pop())
  101    106   
    }
  102    107   
}
  103    108   
  104    109   
pub(crate) fn de_header_integer_header(
  105    110   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  106         -
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
         111  +
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
         112  +
{
  107    113   
    let headers = header_map.get_all("X-Integer");
  108         -
    let var_7 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         114  +
    let var_7 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
  109    115   
    if var_7.len() > 1 {
  110         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
         116  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
  111    117   
            "expected one item but found {}",
  112    118   
            var_7.len()
  113    119   
        )))
  114    120   
    } else {
  115    121   
        let mut var_7 = var_7;
  116    122   
        Ok(var_7.pop())
  117    123   
    }
  118    124   
}
  119    125   
  120    126   
pub(crate) fn de_header_integer_enum_header(
  121    127   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  122         -
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_http::header::ParseError> {
         128  +
) -> ::std::result::Result<::std::option::Option<i32>, ::aws_smithy_legacy_http::header::ParseError>
         129  +
{
  123    130   
    let headers = header_map.get_all("X-IntegerEnum");
  124         -
    let var_8 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         131  +
    let var_8 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
  125    132   
    if var_8.len() > 1 {
  126         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
         133  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
  127    134   
            "expected one item but found {}",
  128    135   
            var_8.len()
  129    136   
        )))
  130    137   
    } else {
  131    138   
        let mut var_8 = var_8;
  132    139   
        Ok(var_8.pop())
  133    140   
    }
  134    141   
}
  135    142   
  136    143   
pub(crate) fn de_header_integer_enum_list_header(
  137    144   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  138    145   
) -> ::std::result::Result<
  139    146   
    ::std::option::Option<::std::vec::Vec<i32>>,
  140         -
    ::aws_smithy_http::header::ParseError,
         147  +
    ::aws_smithy_legacy_http::header::ParseError,
  141    148   
> {
  142    149   
    let headers = header_map.get_all("X-IntegerEnumList");
  143         -
    let var_9 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         150  +
    let var_9 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
  144    151   
    Ok(if !var_9.is_empty() { Some(var_9) } else { None })
  145    152   
}
  146    153   
  147    154   
pub(crate) fn de_header_integer_list_header(
  148    155   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  149    156   
) -> ::std::result::Result<
  150    157   
    ::std::option::Option<::std::vec::Vec<i32>>,
  151         -
    ::aws_smithy_http::header::ParseError,
         158  +
    ::aws_smithy_legacy_http::header::ParseError,
  152    159   
> {
  153    160   
    let headers = header_map.get_all("X-IntegerList");
  154         -
    let var_10 = ::aws_smithy_http::header::read_many_primitive::<i32>(headers)?;
         161  +
    let var_10 = ::aws_smithy_legacy_http::header::read_many_primitive::<i32>(headers)?;
  155    162   
    Ok(if !var_10.is_empty() {
  156    163   
        Some(var_10)
  157    164   
    } else {
  158    165   
        None
  159    166   
    })
  160    167   
}
  161    168   
  162    169   
pub(crate) fn de_header_long_header(
  163    170   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  164         -
) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_http::header::ParseError> {
         171  +
) -> ::std::result::Result<::std::option::Option<i64>, ::aws_smithy_legacy_http::header::ParseError>
         172  +
{
  165    173   
    let headers = header_map.get_all("X-Long");
  166         -
    let var_11 = ::aws_smithy_http::header::read_many_primitive::<i64>(headers)?;
         174  +
    let var_11 = ::aws_smithy_legacy_http::header::read_many_primitive::<i64>(headers)?;
  167    175   
    if var_11.len() > 1 {
  168         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
         176  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
  169    177   
            "expected one item but found {}",
  170    178   
            var_11.len()
  171    179   
        )))
  172    180   
    } else {
  173    181   
        let mut var_11 = var_11;
  174    182   
        Ok(var_11.pop())
  175    183   
    }
  176    184   
}
  177    185   
  178    186   
pub(crate) fn de_header_short_header(
  179    187   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  180         -
) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_http::header::ParseError> {
         188  +
) -> ::std::result::Result<::std::option::Option<i16>, ::aws_smithy_legacy_http::header::ParseError>
         189  +
{
  181    190   
    let headers = header_map.get_all("X-Short");
  182         -
    let var_12 = ::aws_smithy_http::header::read_many_primitive::<i16>(headers)?;
         191  +
    let var_12 = ::aws_smithy_legacy_http::header::read_many_primitive::<i16>(headers)?;
  183    192   
    if var_12.len() > 1 {
  184         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
         193  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
  185    194   
            "expected one item but found {}",
  186    195   
            var_12.len()
  187    196   
        )))
  188    197   
    } else {
  189    198   
        let mut var_12 = var_12;
  190    199   
        Ok(var_12.pop())
  191    200   
    }
  192    201   
}
  193    202   
  194    203   
pub(crate) fn de_header_string_header(
  195    204   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  196    205   
) -> ::std::result::Result<
  197    206   
    ::std::option::Option<::std::string::String>,
  198         -
    ::aws_smithy_http::header::ParseError,
         207  +
    ::aws_smithy_legacy_http::header::ParseError,
  199    208   
> {
  200    209   
    let headers = header_map.get_all("X-String");
  201         -
    ::aws_smithy_http::header::one_or_none(headers)
         210  +
    ::aws_smithy_legacy_http::header::one_or_none(headers)
  202    211   
}
  203    212   
  204    213   
pub(crate) fn de_header_string_list_header(
  205    214   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  206    215   
) -> ::std::result::Result<
  207    216   
    ::std::option::Option<::std::vec::Vec<::std::string::String>>,
  208         -
    ::aws_smithy_http::header::ParseError,
         217  +
    ::aws_smithy_legacy_http::header::ParseError,
  209    218   
> {
  210    219   
    let headers = header_map.get_all("X-StringList");
  211    220   
    let var_13: Vec<::std::string::String> =
  212         -
        ::aws_smithy_http::header::read_many_from_str(headers)?;
         221  +
        ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
  213    222   
    Ok(if !var_13.is_empty() {
  214    223   
        Some(var_13)
  215    224   
    } else {
  216    225   
        None
  217    226   
    })
  218    227   
}
  219    228   
  220    229   
pub(crate) fn de_header_string_set_header(
  221    230   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  222    231   
) -> ::std::result::Result<
  223    232   
    ::std::option::Option<crate::unconstrained::string_set_unconstrained::StringSetUnconstrained>,
  224         -
    ::aws_smithy_http::header::ParseError,
         233  +
    ::aws_smithy_legacy_http::header::ParseError,
  225    234   
> {
  226    235   
    let headers = header_map.get_all("X-StringSet");
  227    236   
    let var_14: Vec<::std::string::String> =
  228         -
        ::aws_smithy_http::header::read_many_from_str(headers)?;
         237  +
        ::aws_smithy_legacy_http::header::read_many_from_str(headers)?;
  229    238   
    Ok(if !var_14.is_empty() {
  230    239   
        Some(crate::unconstrained::string_set_unconstrained::StringSetUnconstrained(var_14))
  231    240   
    } else {
  232    241   
        None
  233    242   
    })
  234    243   
}
  235    244   
  236    245   
pub(crate) fn de_header_timestamp_list_header(
  237    246   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  238    247   
) -> ::std::result::Result<
  239    248   
    ::std::option::Option<::std::vec::Vec<::aws_smithy_http_server_python::types::DateTime>>,
  240         -
    ::aws_smithy_http::header::ParseError,
         249  +
    ::aws_smithy_legacy_http::header::ParseError,
  241    250   
> {
  242    251   
    let headers = header_map.get_all("X-TimestampList");
  243    252   
    let var_15: Vec<::aws_smithy_http_server_python::types::DateTime> =
  244         -
        ::aws_smithy_http::header::many_dates(
         253  +
        ::aws_smithy_legacy_http::header::many_dates(
  245    254   
            headers,
  246    255   
            ::aws_smithy_types::date_time::Format::HttpDate,
  247    256   
        )?
  248    257   
        .into_iter()
  249    258   
        .map(::aws_smithy_http_server_python::types::DateTime::from)
  250    259   
        .collect();
  251    260   
    Ok(if !var_15.is_empty() {
  252    261   
        Some(var_15)
  253    262   
    } else {
  254    263   
        None
  255    264   
    })
  256    265   
}
  257    266   
  258    267   
pub(crate) fn de_header_true_bool_header(
  259    268   
    header_map: &::aws_smithy_runtime_api::http::Headers,
  260         -
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_http::header::ParseError> {
         269  +
) -> ::std::result::Result<::std::option::Option<bool>, ::aws_smithy_legacy_http::header::ParseError>
         270  +
{
  261    271   
    let headers = header_map.get_all("X-Boolean1");
  262         -
    let var_16 = ::aws_smithy_http::header::read_many_primitive::<bool>(headers)?;
         272  +
    let var_16 = ::aws_smithy_legacy_http::header::read_many_primitive::<bool>(headers)?;
  263    273   
    if var_16.len() > 1 {
  264         -
        Err(::aws_smithy_http::header::ParseError::new(format!(
         274  +
        Err(::aws_smithy_legacy_http::header::ParseError::new(format!(
  265    275   
            "expected one item but found {}",
  266    276   
            var_16.len()
  267    277   
        )))
  268    278   
    } else {
  269    279   
        let mut var_16 = var_16;
  270    280   
        Ok(var_16.pop())
  271    281   
    }
  272    282   
}

tmp-codegen-diff/codegen-server-test-python/rest_json/rust-server-codegen-python/src/protocol_serde/shape_json_blobs.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_json_blobs_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::JsonBlobsInput,
    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_blobs_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_blobs::de_json_blobs(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_blobs_http_response(
   36     36   
    #[allow(unused_variables)] output: crate::output::JsonBlobsOutput,
   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_blobs_output::ser_json_blobs_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_blobs_http_error(
   68     68   
    error: &crate::error::JsonBlobsError,
   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::JsonBlobsError::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_json_blobs(
  104    104   
    value: &[u8],
  105    105   
    mut builder: crate::input::json_blobs_input_internal::Builder,
  106    106   
) -> ::std::result::Result<
  107    107   
    crate::input::json_blobs_input_internal::Builder,