Server Test Python

Server Test Python

rev. 03e6e47f15dfd569240d570d98975ebba692c405

Files changed:

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_case_insensitive_error_operation.rs

@@ -1,1 +141,143 @@
    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_case_insensitive_error_operation_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::CaseInsensitiveErrorOperationInput,
    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::case_insensitive_error_operation_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_case_insensitive_error_operation_http_response(
   30     32   
    #[allow(unused_variables)] output: crate::output::CaseInsensitiveErrorOperationOutput,
   31     33   
) -> std::result::Result<
   32         -
    ::aws_smithy_http_server::response::Response,
   33         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          34  +
    ::aws_smithy_legacy_http_server::response::Response,
          35  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   34     36   
> {
   35     37   
    Ok({
   36     38   
        #[allow(unused_mut)]
   37     39   
        let mut builder = ::http::Response::builder();
   38         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          40  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   39     41   
            builder,
   40     42   
            ::http::header::CONTENT_TYPE,
   41     43   
            "application/json",
   42     44   
        );
   43     45   
        let http_status: u16 = 200;
   44     46   
        builder = builder.status(http_status);
   45     47   
        let payload = "";
   46     48   
        let content_length = payload.len();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     50   
            builder,
   49     51   
            ::http::header::CONTENT_LENGTH,
   50     52   
            content_length,
   51     53   
        );
   52         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          54  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   53     55   
        builder.body(body)?
   54     56   
    })
   55     57   
}
   56     58   
   57     59   
#[allow(clippy::unnecessary_wraps)]
   58     60   
pub fn ser_case_insensitive_error_operation_http_error(
   59     61   
    error: &crate::error::CaseInsensitiveErrorOperationError,
   60     62   
) -> std::result::Result<
   61         -
    ::aws_smithy_http_server::response::Response,
   62         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          63  +
    ::aws_smithy_legacy_http_server::response::Response,
          64  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   63     65   
> {
   64     66   
    Ok({
   65     67   
        match error {
   66     68   
            crate::error::CaseInsensitiveErrorOperationError::CaseInsensitiveError(output) => {
   67     69   
                let payload = crate::protocol_serde::shape_case_insensitive_error::ser_case_insensitive_error_error(output)?;
   68     70   
                #[allow(unused_mut)]
   69     71   
                let mut builder = ::http::Response::builder();
   70         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          72  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   71     73   
                    builder,
   72     74   
                    ::http::header::CONTENT_TYPE,
   73     75   
                    "application/json",
   74     76   
                );
   75         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          77  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   76     78   
                    builder,
   77     79   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   78     80   
                    "CaseInsensitiveError",
   79     81   
                );
   80     82   
                let content_length = payload.len();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          83  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     84   
                    builder,
   83     85   
                    ::http::header::CONTENT_LENGTH,
   84     86   
                    content_length,
   85     87   
                );
   86     88   
                builder
   87     89   
                    .status(500)
   88         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          90  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   89     91   
            }
   90     92   
            crate::error::CaseInsensitiveErrorOperationError::ExtraError(output) => {
   91     93   
                let payload =
   92     94   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   93     95   
                #[allow(unused_mut)]
   94     96   
                let mut builder = ::http::Response::builder();
   95         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          97  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   96     98   
                    builder,
   97     99   
                    ::http::header::CONTENT_TYPE,
   98    100   
                    "application/json",
   99    101   
                );
  100         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         102  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  101    103   
                    builder,
  102    104   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  103    105   
                    "ExtraError",
  104    106   
                );
  105    107   
                let content_length = payload.len();
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         108  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    109   
                    builder,
  108    110   
                    ::http::header::CONTENT_LENGTH,
  109    111   
                    content_length,
  110    112   
                );
  111    113   
                builder
  112    114   
                    .status(500)
  113         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         115  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  114    116   
            }
  115    117   
            crate::error::CaseInsensitiveErrorOperationError::InternalServerError(output) => {
  116    118   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  117    119   
                #[allow(unused_mut)]
  118    120   
                let mut builder = ::http::Response::builder();
  119         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         121  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  120    122   
                    builder,
  121    123   
                    ::http::header::CONTENT_TYPE,
  122    124   
                    "application/json",
  123    125   
                );
  124         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  125    127   
                    builder,
  126    128   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  127    129   
                    "InternalServerError",
  128    130   
                );
  129    131   
                let content_length = payload.len();
  130         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         132  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  131    133   
                    builder,
  132    134   
                    ::http::header::CONTENT_LENGTH,
  133    135   
                    content_length,
  134    136   
                );
  135    137   
                builder
  136    138   
                    .status(500)
  137         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         139  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  138    140   
            }
  139    141   
        }
  140    142   
    })
  141    143   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_empty_struct_with_content_on_wire_op.rs

@@ -1,1 +119,121 @@
    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_empty_struct_with_content_on_wire_op_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EmptyStructWithContentOnWireOpInput,
    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::empty_struct_with_content_on_wire_op_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_empty_struct_with_content_on_wire_op_http_response(
   30     32   
    #[allow(unused_variables)] output: crate::output::EmptyStructWithContentOnWireOpOutput,
   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_empty_struct_with_content_on_wire_op_output::ser_empty_struct_with_content_on_wire_op_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_empty_struct_with_content_on_wire_op_http_error(
   61     63   
    error: &crate::error::EmptyStructWithContentOnWireOpError,
   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::EmptyStructWithContentOnWireOpError::ExtraError(output) => {
   69     71   
                let payload =
   70     72   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   71     73   
                #[allow(unused_mut)]
   72     74   
                let mut builder = ::http::Response::builder();
   73         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          75  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   74     76   
                    builder,
   75     77   
                    ::http::header::CONTENT_TYPE,
   76     78   
                    "application/json",
   77     79   
                );
   78         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          80  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   79     81   
                    builder,
   80     82   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   81     83   
                    "ExtraError",
   82     84   
                );
   83     85   
                let content_length = payload.len();
   84         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   85     87   
                    builder,
   86     88   
                    ::http::header::CONTENT_LENGTH,
   87     89   
                    content_length,
   88     90   
                );
   89     91   
                builder
   90     92   
                    .status(500)
   91         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          93  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   92     94   
            }
   93     95   
            crate::error::EmptyStructWithContentOnWireOpError::InternalServerError(output) => {
   94     96   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   95     97   
                #[allow(unused_mut)]
   96     98   
                let mut builder = ::http::Response::builder();
   97         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          99  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   98    100   
                    builder,
   99    101   
                    ::http::header::CONTENT_TYPE,
  100    102   
                    "application/json",
  101    103   
                );
  102         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         104  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  103    105   
                    builder,
  104    106   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  105    107   
                    "InternalServerError",
  106    108   
                );
  107    109   
                let content_length = payload.len();
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         110  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  109    111   
                    builder,
  110    112   
                    ::http::header::CONTENT_LENGTH,
  111    113   
                    content_length,
  112    114   
                );
  113    115   
                builder
  114    116   
                    .status(500)
  115         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         117  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  116    118   
            }
  117    119   
        }
  118    120   
    })
  119    121   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_enum_query.rs

@@ -1,1 +156,156 @@
    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_enum_query_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EnumQueryInput,
    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::enum_query_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)) =
   24     24   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     25   
                ::nom::sequence::preceded(
   26     26   
                    ::nom::bytes::complete::tag("/"),
   27     27   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("foo"),
   28     28   
                ),
   29     29   
                ::nom::sequence::preceded(
   30     30   
                    ::nom::bytes::complete::tag("/"),
   31     31   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   32     32   
                        ::nom::bytes::complete::take_until("/"),
   33     33   
                        ::nom::combinator::rest,
   34     34   
                    )),
   35     35   
                ),
   36     36   
            ))(input_string)?;
   37     37   
        debug_assert_eq!("", input_string);
   38     38   
        input = input.set_enum(crate::protocol_serde::shape_enum_query_input::de_enum(m1)?);
   39     39   
        input.build()?
   40     40   
    })
   41     41   
}
   42     42   
   43     43   
#[allow(clippy::unnecessary_wraps)]
   44     44   
pub fn ser_enum_query_http_response(
   45     45   
    #[allow(unused_variables)] output: crate::output::EnumQueryOutput,
   46     46   
) -> std::result::Result<
   47         -
    ::aws_smithy_http_server::response::Response,
   48         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          47  +
    ::aws_smithy_legacy_http_server::response::Response,
          48  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   49     49   
> {
   50     50   
    Ok({
   51     51   
        #[allow(unused_mut)]
   52     52   
        let mut builder = ::http::Response::builder();
   53         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          53  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   54     54   
            builder,
   55     55   
            ::http::header::CONTENT_TYPE,
   56     56   
            "application/json",
   57     57   
        );
   58     58   
        let http_status: u16 = 200;
   59     59   
        builder = builder.status(http_status);
   60     60   
        let payload = "";
   61     61   
        let content_length = payload.len();
   62         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          62  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   63     63   
            builder,
   64     64   
            ::http::header::CONTENT_LENGTH,
   65     65   
            content_length,
   66     66   
        );
   67         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          67  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   68     68   
        builder.body(body)?
   69     69   
    })
   70     70   
}
   71     71   
   72     72   
#[allow(clippy::unnecessary_wraps)]
   73     73   
pub fn ser_enum_query_http_error(
   74     74   
    error: &crate::error::EnumQueryError,
   75     75   
) -> std::result::Result<
   76         -
    ::aws_smithy_http_server::response::Response,
   77         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          76  +
    ::aws_smithy_legacy_http_server::response::Response,
          77  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78     78   
> {
   79     79   
    Ok({
   80     80   
        match error {
   81     81   
            crate::error::EnumQueryError::ValidationException(output) => {
   82     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   83     83   
                #[allow(unused_mut)]
   84     84   
                let mut builder = ::http::Response::builder();
   85         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          85  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   86     86   
                    builder,
   87     87   
                    ::http::header::CONTENT_TYPE,
   88     88   
                    "application/json",
   89     89   
                );
   90         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          90  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   91     91   
                    builder,
   92     92   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93     93   
                    "ValidationException",
   94     94   
                );
   95     95   
                let content_length = payload.len();
   96         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          96  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   97     97   
                    builder,
   98     98   
                    ::http::header::CONTENT_LENGTH,
   99     99   
                    content_length,
  100    100   
                );
  101    101   
                builder
  102    102   
                    .status(400)
  103         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         103  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  104    104   
            }
  105    105   
            crate::error::EnumQueryError::ExtraError(output) => {
  106    106   
                let payload =
  107    107   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
  108    108   
                #[allow(unused_mut)]
  109    109   
                let mut builder = ::http::Response::builder();
  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::CONTENT_TYPE,
  113    113   
                    "application/json",
  114    114   
                );
  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::HeaderName::from_static("x-amzn-errortype"),
  118    118   
                    "ExtraError",
  119    119   
                );
  120    120   
                let content_length = payload.len();
  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::CONTENT_LENGTH,
  124    124   
                    content_length,
  125    125   
                );
  126    126   
                builder
  127    127   
                    .status(500)
  128         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         128  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  129    129   
            }
  130    130   
            crate::error::EnumQueryError::InternalServerError(output) => {
  131    131   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  132    132   
                #[allow(unused_mut)]
  133    133   
                let mut builder = ::http::Response::builder();
  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::CONTENT_TYPE,
  137    137   
                    "application/json",
  138    138   
                );
  139         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         139  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  140    140   
                    builder,
  141    141   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  142    142   
                    "InternalServerError",
  143    143   
                );
  144    144   
                let content_length = payload.len();
  145         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         145  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  146    146   
                    builder,
  147    147   
                    ::http::header::CONTENT_LENGTH,
  148    148   
                    content_length,
  149    149   
                );
  150    150   
                builder
  151    151   
                    .status(500)
  152         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         152  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  153    153   
            }
  154    154   
        }
  155    155   
    })
  156    156   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_enum_query_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_enum(
    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_extras/rust-server-codegen-python/src/protocol_serde/shape_escaped_string_values.rs

@@ -1,1 +178,178 @@
    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_escaped_string_values_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EscapedStringValuesInput,
    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::escaped_string_values_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_escaped_string_values::de_escaped_string_values(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        input.build()?
   34     34   
    })
   35     35   
}
   36     36   
   37     37   
#[allow(clippy::unnecessary_wraps)]
   38     38   
pub fn ser_escaped_string_values_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::EscapedStringValuesOutput,
   40     40   
) -> std::result::Result<
   41         -
    ::aws_smithy_http_server::response::Response,
   42         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46     46   
        let mut builder = ::http::Response::builder();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49     49   
            ::http::header::CONTENT_TYPE,
   50     50   
            "application/json",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_escaped_string_values_output::ser_escaped_string_values_output_output_output(&output)?
   56     56   
        ;
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_escaped_string_values_http_error(
   70     70   
    error: &crate::error::EscapedStringValuesError,
   71     71   
) -> std::result::Result<
   72         -
    ::aws_smithy_http_server::response::Response,
   73         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          72  +
    ::aws_smithy_legacy_http_server::response::Response,
          73  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     74   
> {
   75     75   
    Ok({
   76     76   
        match error {
   77     77   
            crate::error::EscapedStringValuesError::ValidationException(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80     80   
                let mut builder = ::http::Response::builder();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          81  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83     83   
                    ::http::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88     88   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "ValidationException",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(400)
   99         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          99  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
            crate::error::EscapedStringValuesError::ExtraError(output) => {
  102    102   
                let payload =
  103    103   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
  104    104   
                #[allow(unused_mut)]
  105    105   
                let mut builder = ::http::Response::builder();
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         106  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    107   
                    builder,
  108    108   
                    ::http::header::CONTENT_TYPE,
  109    109   
                    "application/json",
  110    110   
                );
  111         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         111  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  112    112   
                    builder,
  113    113   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    114   
                    "ExtraError",
  115    115   
                );
  116    116   
                let content_length = payload.len();
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119    119   
                    ::http::header::CONTENT_LENGTH,
  120    120   
                    content_length,
  121    121   
                );
  122    122   
                builder
  123    123   
                    .status(500)
  124         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         124  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  125    125   
            }
  126    126   
            crate::error::EscapedStringValuesError::InternalServerError(output) => {
  127    127   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  128    128   
                #[allow(unused_mut)]
  129    129   
                let mut builder = ::http::Response::builder();
  130         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         130  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  131    131   
                    builder,
  132    132   
                    ::http::header::CONTENT_TYPE,
  133    133   
                    "application/json",
  134    134   
                );
  135         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  136    136   
                    builder,
  137    137   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  138    138   
                    "InternalServerError",
  139    139   
                );
  140    140   
                let content_length = payload.len();
  141         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         141  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  142    142   
                    builder,
  143    143   
                    ::http::header::CONTENT_LENGTH,
  144    144   
                    content_length,
  145    145   
                );
  146    146   
                builder
  147    147   
                    .status(500)
  148         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         148  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  149    149   
            }
  150    150   
        }
  151    151   
    })
  152    152   
}
  153    153   
  154    154   
pub(crate) fn de_escaped_string_values(
  155    155   
    value: &[u8],
  156    156   
    mut builder: crate::input::escaped_string_values_input_internal::Builder,
  157    157   
) -> ::std::result::Result<
  158    158   
    crate::input::escaped_string_values_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_http_query_params_only_operation.rs

@@ -1,1 +128,128 @@
    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_query_params_only_operation_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HttpQueryParamsOnlyOperationInput,
    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_query_params_only_operation_input_internal::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        let query_string = uri.query().unwrap_or("");
   24     24   
        let pairs = ::form_urlencoded::parse(query_string.as_bytes());
   25     25   
        let mut query_params: ::std::collections::HashMap<
   26     26   
            ::std::string::String,
   27     27   
            ::std::string::String,
   28     28   
        > = ::std::collections::HashMap::new();
   29     29   
        for (k, v) in pairs {
   30     30   
            query_params
   31     31   
                .entry(String::from(k))
   32     32   
                .or_insert_with(|| String::from(v));
   33     33   
        }
   34     34   
        input = input.set_query_map(Some(query_params));
   35     35   
        input.build()
   36     36   
    })
   37     37   
}
   38     38   
   39     39   
#[allow(clippy::unnecessary_wraps)]
   40     40   
pub fn ser_http_query_params_only_operation_http_response(
   41     41   
    #[allow(unused_variables)] output: crate::output::HttpQueryParamsOnlyOperationOutput,
   42     42   
) -> std::result::Result<
   43         -
    ::aws_smithy_http_server::response::Response,
   44         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          43  +
    ::aws_smithy_legacy_http_server::response::Response,
          44  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   45     45   
> {
   46     46   
    Ok({
   47     47   
        #[allow(unused_mut)]
   48     48   
        let mut builder = ::http::Response::builder();
   49         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          49  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51     51   
            ::http::header::CONTENT_TYPE,
   52     52   
            "application/json",
   53     53   
        );
   54     54   
        let http_status: u16 = 200;
   55     55   
        builder = builder.status(http_status);
   56     56   
        let payload = "";
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_http_query_params_only_operation_http_error(
   70     70   
    error: &crate::error::HttpQueryParamsOnlyOperationError,
   71     71   
) -> std::result::Result<
   72         -
    ::aws_smithy_http_server::response::Response,
   73         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          72  +
    ::aws_smithy_legacy_http_server::response::Response,
          73  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     74   
> {
   75     75   
    Ok({
   76     76   
        match error {
   77     77   
            crate::error::HttpQueryParamsOnlyOperationError::ExtraError(output) => {
   78     78   
                let payload =
   79     79   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   80     80   
                #[allow(unused_mut)]
   81     81   
                let mut builder = ::http::Response::builder();
   82         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   83     83   
                    builder,
   84     84   
                    ::http::header::CONTENT_TYPE,
   85     85   
                    "application/json",
   86     86   
                );
   87         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          87  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   88     88   
                    builder,
   89     89   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   90     90   
                    "ExtraError",
   91     91   
                );
   92     92   
                let content_length = payload.len();
   93         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          93  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   94     94   
                    builder,
   95     95   
                    ::http::header::CONTENT_LENGTH,
   96     96   
                    content_length,
   97     97   
                );
   98     98   
                builder
   99     99   
                    .status(500)
  100         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         100  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  101    101   
            }
  102    102   
            crate::error::HttpQueryParamsOnlyOperationError::InternalServerError(output) => {
  103    103   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  104    104   
                #[allow(unused_mut)]
  105    105   
                let mut builder = ::http::Response::builder();
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         106  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    107   
                    builder,
  108    108   
                    ::http::header::CONTENT_TYPE,
  109    109   
                    "application/json",
  110    110   
                );
  111         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         111  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  112    112   
                    builder,
  113    113   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    114   
                    "InternalServerError",
  115    115   
                );
  116    116   
                let content_length = payload.len();
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119    119   
                    ::http::header::CONTENT_LENGTH,
  120    120   
                    content_length,
  121    121   
                );
  122    122   
                builder
  123    123   
                    .status(500)
  124         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         124  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  125    125   
            }
  126    126   
        }
  127    127   
    })
  128    128   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_map_with_enum_key_op.rs

@@ -1,1 +178,178 @@
    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_map_with_enum_key_op_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::MapWithEnumKeyOpInput,
    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::map_with_enum_key_op_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_map_with_enum_key_op::de_map_with_enum_key_op(
   29     29   
                bytes.as_ref(),
   30     30   
                input,
   31     31   
            )?;
   32     32   
        }
   33     33   
        input.build()?
   34     34   
    })
   35     35   
}
   36     36   
   37     37   
#[allow(clippy::unnecessary_wraps)]
   38     38   
pub fn ser_map_with_enum_key_op_http_response(
   39     39   
    #[allow(unused_variables)] output: crate::output::MapWithEnumKeyOpOutput,
   40     40   
) -> std::result::Result<
   41         -
    ::aws_smithy_http_server::response::Response,
   42         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          41  +
    ::aws_smithy_legacy_http_server::response::Response,
          42  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     43   
> {
   44     44   
    Ok({
   45     45   
        #[allow(unused_mut)]
   46     46   
        let mut builder = ::http::Response::builder();
   47         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          47  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49     49   
            ::http::header::CONTENT_TYPE,
   50     50   
            "application/json",
   51     51   
        );
   52     52   
        let http_status: u16 = 200;
   53     53   
        builder = builder.status(http_status);
   54     54   
        let payload =
   55     55   
            crate::protocol_serde::shape_map_with_enum_key_op_output::ser_map_with_enum_key_op_output_output_output(&output)?
   56     56   
        ;
   57     57   
        let content_length = payload.len();
   58         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          58  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   59     59   
            builder,
   60     60   
            ::http::header::CONTENT_LENGTH,
   61     61   
            content_length,
   62     62   
        );
   63         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          63  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   64     64   
        builder.body(body)?
   65     65   
    })
   66     66   
}
   67     67   
   68     68   
#[allow(clippy::unnecessary_wraps)]
   69     69   
pub fn ser_map_with_enum_key_op_http_error(
   70     70   
    error: &crate::error::MapWithEnumKeyOpError,
   71     71   
) -> std::result::Result<
   72         -
    ::aws_smithy_http_server::response::Response,
   73         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          72  +
    ::aws_smithy_legacy_http_server::response::Response,
          73  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74     74   
> {
   75     75   
    Ok({
   76     76   
        match error {
   77     77   
            crate::error::MapWithEnumKeyOpError::ValidationException(output) => {
   78     78   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   79     79   
                #[allow(unused_mut)]
   80     80   
                let mut builder = ::http::Response::builder();
   81         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          81  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   82     82   
                    builder,
   83     83   
                    ::http::header::CONTENT_TYPE,
   84     84   
                    "application/json",
   85     85   
                );
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     87   
                    builder,
   88     88   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89     89   
                    "ValidationException",
   90     90   
                );
   91     91   
                let content_length = payload.len();
   92         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          92  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   93     93   
                    builder,
   94     94   
                    ::http::header::CONTENT_LENGTH,
   95     95   
                    content_length,
   96     96   
                );
   97     97   
                builder
   98     98   
                    .status(400)
   99         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          99  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  100    100   
            }
  101    101   
            crate::error::MapWithEnumKeyOpError::ExtraError(output) => {
  102    102   
                let payload =
  103    103   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
  104    104   
                #[allow(unused_mut)]
  105    105   
                let mut builder = ::http::Response::builder();
  106         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         106  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  107    107   
                    builder,
  108    108   
                    ::http::header::CONTENT_TYPE,
  109    109   
                    "application/json",
  110    110   
                );
  111         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         111  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  112    112   
                    builder,
  113    113   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    114   
                    "ExtraError",
  115    115   
                );
  116    116   
                let content_length = payload.len();
  117         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         117  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  118    118   
                    builder,
  119    119   
                    ::http::header::CONTENT_LENGTH,
  120    120   
                    content_length,
  121    121   
                );
  122    122   
                builder
  123    123   
                    .status(500)
  124         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         124  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  125    125   
            }
  126    126   
            crate::error::MapWithEnumKeyOpError::InternalServerError(output) => {
  127    127   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  128    128   
                #[allow(unused_mut)]
  129    129   
                let mut builder = ::http::Response::builder();
  130         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         130  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  131    131   
                    builder,
  132    132   
                    ::http::header::CONTENT_TYPE,
  133    133   
                    "application/json",
  134    134   
                );
  135         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         135  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  136    136   
                    builder,
  137    137   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  138    138   
                    "InternalServerError",
  139    139   
                );
  140    140   
                let content_length = payload.len();
  141         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         141  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  142    142   
                    builder,
  143    143   
                    ::http::header::CONTENT_LENGTH,
  144    144   
                    content_length,
  145    145   
                );
  146    146   
                builder
  147    147   
                    .status(500)
  148         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         148  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  149    149   
            }
  150    150   
        }
  151    151   
    })
  152    152   
}
  153    153   
  154    154   
pub(crate) fn de_map_with_enum_key_op(
  155    155   
    value: &[u8],
  156    156   
    mut builder: crate::input::map_with_enum_key_op_input_internal::Builder,
  157    157   
) -> ::std::result::Result<
  158    158   
    crate::input::map_with_enum_key_op_input_internal::Builder,

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_null_in_non_sparse.rs

@@ -1,1 +118,120 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_null_in_non_sparse_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::NullInNonSparseInput,
    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::null_in_non_sparse_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_null_in_non_sparse_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::NullInNonSparseOutput,
   30     32   
) -> std::result::Result<
   31         -
    ::aws_smithy_http_server::response::Response,
   32         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          33  +
    ::aws_smithy_legacy_http_server::response::Response,
          34  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     35   
> {
   34     36   
    Ok({
   35     37   
        #[allow(unused_mut)]
   36     38   
        let mut builder = ::http::Response::builder();
   37         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          39  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   38     40   
            builder,
   39     41   
            ::http::header::CONTENT_TYPE,
   40     42   
            "application/json",
   41     43   
        );
   42     44   
        let http_status: u16 = 200;
   43     45   
        builder = builder.status(http_status);
   44     46   
        let payload =
   45     47   
            crate::protocol_serde::shape_null_in_non_sparse_output::ser_null_in_non_sparse_output_output_output(&output)?
   46     48   
        ;
   47     49   
        let content_length = payload.len();
   48         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          50  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   49     51   
            builder,
   50     52   
            ::http::header::CONTENT_LENGTH,
   51     53   
            content_length,
   52     54   
        );
   53         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          55  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   54     56   
        builder.body(body)?
   55     57   
    })
   56     58   
}
   57     59   
   58     60   
#[allow(clippy::unnecessary_wraps)]
   59     61   
pub fn ser_null_in_non_sparse_http_error(
   60     62   
    error: &crate::error::NullInNonSparseError,
   61     63   
) -> std::result::Result<
   62         -
    ::aws_smithy_http_server::response::Response,
   63         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          64  +
    ::aws_smithy_legacy_http_server::response::Response,
          65  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     66   
> {
   65     67   
    Ok({
   66     68   
        match error {
   67     69   
            crate::error::NullInNonSparseError::ExtraError(output) => {
   68     70   
                let payload =
   69     71   
                    crate::protocol_serde::shape_extra_error::ser_extra_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   
                    "ExtraError",
   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   
            crate::error::NullInNonSparseError::InternalServerError(output) => {
   93     95   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   94     96   
                #[allow(unused_mut)]
   95     97   
                let mut builder = ::http::Response::builder();
   96         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          98  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   97     99   
                    builder,
   98    100   
                    ::http::header::CONTENT_TYPE,
   99    101   
                    "application/json",
  100    102   
                );
  101         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         103  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  102    104   
                    builder,
  103    105   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  104    106   
                    "InternalServerError",
  105    107   
                );
  106    108   
                let content_length = payload.len();
  107         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         109  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  108    110   
                    builder,
  109    111   
                    ::http::header::CONTENT_LENGTH,
  110    112   
                    content_length,
  111    113   
                );
  112    114   
                builder
  113    115   
                    .status(500)
  114         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         116  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  115    117   
            }
  116    118   
        }
  117    119   
    })
  118    120   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_primitive_int_header.rs

@@ -1,1 +171,173 @@
    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_primitive_int_header_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::PrimitiveIntHeaderInput,
    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::primitive_int_header_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_primitive_int_header_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::PrimitiveIntHeaderOutput,
   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     39   
        builder =
   38     40   
            crate::protocol_serde::shape_primitive_int_header::ser_primitive_int_header_headers(
   39     41   
                &output, builder,
   40     42   
            )?;
   41         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          43  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   42     44   
            builder,
   43     45   
            ::http::header::CONTENT_TYPE,
   44     46   
            "application/json",
   45     47   
        );
   46     48   
        let http_status: u16 = 200;
   47     49   
        builder = builder.status(http_status);
   48     50   
        let payload =
   49     51   
            crate::protocol_serde::shape_primitive_int_header_output::ser_primitive_int_header_output_output_output(&output)?
   50     52   
        ;
   51     53   
        let content_length = payload.len();
   52         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          54  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   53     55   
            builder,
   54     56   
            ::http::header::CONTENT_LENGTH,
   55     57   
            content_length,
   56     58   
        );
   57         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          59  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   58     60   
        builder.body(body)?
   59     61   
    })
   60     62   
}
   61     63   
   62     64   
#[allow(clippy::unnecessary_wraps)]
   63     65   
pub fn ser_primitive_int_header_http_error(
   64     66   
    error: &crate::error::PrimitiveIntHeaderError,
   65     67   
) -> std::result::Result<
   66         -
    ::aws_smithy_http_server::response::Response,
   67         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          68  +
    ::aws_smithy_legacy_http_server::response::Response,
          69  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   68     70   
> {
   69     71   
    Ok({
   70     72   
        match error {
   71     73   
            crate::error::PrimitiveIntHeaderError::ValidationException(output) => {
   72     74   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   73     75   
                #[allow(unused_mut)]
   74     76   
                let mut builder = ::http::Response::builder();
   75         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          77  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   76     78   
                    builder,
   77     79   
                    ::http::header::CONTENT_TYPE,
   78     80   
                    "application/json",
   79     81   
                );
   80         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          82  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   81     83   
                    builder,
   82     84   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   83     85   
                    "ValidationException",
   84     86   
                );
   85     87   
                let content_length = payload.len();
   86         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          88  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   87     89   
                    builder,
   88     90   
                    ::http::header::CONTENT_LENGTH,
   89     91   
                    content_length,
   90     92   
                );
   91     93   
                builder
   92     94   
                    .status(400)
   93         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          95  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   94     96   
            }
   95     97   
            crate::error::PrimitiveIntHeaderError::ExtraError(output) => {
   96     98   
                let payload =
   97     99   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   98    100   
                #[allow(unused_mut)]
   99    101   
                let mut builder = ::http::Response::builder();
  100         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         102  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  101    103   
                    builder,
  102    104   
                    ::http::header::CONTENT_TYPE,
  103    105   
                    "application/json",
  104    106   
                );
  105         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         107  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  106    108   
                    builder,
  107    109   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  108    110   
                    "ExtraError",
  109    111   
                );
  110    112   
                let content_length = payload.len();
  111         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         113  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  112    114   
                    builder,
  113    115   
                    ::http::header::CONTENT_LENGTH,
  114    116   
                    content_length,
  115    117   
                );
  116    118   
                builder
  117    119   
                    .status(500)
  118         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         120  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  119    121   
            }
  120    122   
            crate::error::PrimitiveIntHeaderError::InternalServerError(output) => {
  121    123   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  122    124   
                #[allow(unused_mut)]
  123    125   
                let mut builder = ::http::Response::builder();
  124         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         126  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  125    127   
                    builder,
  126    128   
                    ::http::header::CONTENT_TYPE,
  127    129   
                    "application/json",
  128    130   
                );
  129         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         131  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  130    132   
                    builder,
  131    133   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  132    134   
                    "InternalServerError",
  133    135   
                );
  134    136   
                let content_length = payload.len();
  135         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         137  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  136    138   
                    builder,
  137    139   
                    ::http::header::CONTENT_LENGTH,
  138    140   
                    content_length,
  139    141   
                );
  140    142   
                builder
  141    143   
                    .status(500)
  142         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         144  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  143    145   
            }
  144    146   
        }
  145    147   
    })
  146    148   
}
  147    149   
  148    150   
pub fn ser_primitive_int_header_headers(
  149    151   
    input: &crate::output::PrimitiveIntHeaderOutput,
  150    152   
    mut builder: ::http::response::Builder,
  151    153   
) -> std::result::Result<::http::response::Builder, ::aws_smithy_types::error::operation::BuildError>
  152    154   
{

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_primitive_int_op.rs

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

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

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

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_query_precedence_input.rs

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

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_status_response.rs

@@ -1,1 +119,121 @@
    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_status_response_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StatusResponseInput,
    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::status_response_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_status_response_http_response(
   29     31   
    #[allow(unused_variables)] output: crate::output::StatusResponseOutput,
   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.field;
   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_status_response_output::ser_status_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_status_response_http_error(
   61     63   
    error: &crate::error::StatusResponseError,
   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::StatusResponseError::ExtraError(output) => {
   69     71   
                let payload =
   70     72   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
   71     73   
                #[allow(unused_mut)]
   72     74   
                let mut builder = ::http::Response::builder();
   73         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          75  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   74     76   
                    builder,
   75     77   
                    ::http::header::CONTENT_TYPE,
   76     78   
                    "application/json",
   77     79   
                );
   78         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          80  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   79     81   
                    builder,
   80     82   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   81     83   
                    "ExtraError",
   82     84   
                );
   83     85   
                let content_length = payload.len();
   84         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          86  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   85     87   
                    builder,
   86     88   
                    ::http::header::CONTENT_LENGTH,
   87     89   
                    content_length,
   88     90   
                );
   89     91   
                builder
   90     92   
                    .status(500)
   91         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
          93  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
   92     94   
            }
   93     95   
            crate::error::StatusResponseError::InternalServerError(output) => {
   94     96   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
   95     97   
                #[allow(unused_mut)]
   96     98   
                let mut builder = ::http::Response::builder();
   97         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
          99  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   98    100   
                    builder,
   99    101   
                    ::http::header::CONTENT_TYPE,
  100    102   
                    "application/json",
  101    103   
                );
  102         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         104  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  103    105   
                    builder,
  104    106   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  105    107   
                    "InternalServerError",
  106    108   
                );
  107    109   
                let content_length = payload.len();
  108         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         110  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  109    111   
                    builder,
  110    112   
                    ::http::header::CONTENT_LENGTH,
  111    113   
                    content_length,
  112    114   
                );
  113    115   
                builder
  114    116   
                    .status(500)
  115         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         117  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  116    118   
            }
  117    119   
        }
  118    120   
    })
  119    121   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_string_payload.rs

@@ -1,1 +129,129 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_string_payload_http_request<B>(
    4      4   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::StringPayloadInput,
    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::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_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_string_payload_http_response(
   40     40   
    #[allow(unused_variables)] output: crate::output::StringPayloadOutput,
   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 = crate::protocol_serde::shape_string_payload_output::ser_payload_http_payload(
   56     56   
            output.payload,
   57     57   
        )?;
   58     58   
        let content_length = payload.len();
   59         -
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
          59  +
        builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
   60     60   
            builder,
   61     61   
            ::http::header::CONTENT_LENGTH,
   62     62   
            content_length,
   63     63   
        );
   64         -
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          64  +
        let body = ::aws_smithy_legacy_http_server::body::to_boxed(payload);
   65     65   
        builder.body(body)?
   66     66   
    })
   67     67   
}
   68     68   
   69     69   
#[allow(clippy::unnecessary_wraps)]
   70     70   
pub fn ser_string_payload_http_error(
   71     71   
    error: &crate::error::StringPayloadError,
   72     72   
) -> std::result::Result<
   73         -
    ::aws_smithy_http_server::response::Response,
   74         -
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
          73  +
    ::aws_smithy_legacy_http_server::response::Response,
          74  +
    ::aws_smithy_legacy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   75     75   
> {
   76     76   
    Ok({
   77     77   
        match error {
   78     78   
            crate::error::StringPayloadError::ExtraError(output) => {
   79     79   
                let payload =
   80     80   
                    crate::protocol_serde::shape_extra_error::ser_extra_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   
                    "ExtraError",
   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   
            crate::error::StringPayloadError::InternalServerError(output) => {
  104    104   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
  105    105   
                #[allow(unused_mut)]
  106    106   
                let mut builder = ::http::Response::builder();
  107         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         107  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  108    108   
                    builder,
  109    109   
                    ::http::header::CONTENT_TYPE,
  110    110   
                    "text/plain",
  111    111   
                );
  112         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         112  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  113    113   
                    builder,
  114    114   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  115    115   
                    "InternalServerError",
  116    116   
                );
  117    117   
                let content_length = payload.len();
  118         -
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
         118  +
                builder = ::aws_smithy_legacy_http::header::set_response_header_if_absent(
  119    119   
                    builder,
  120    120   
                    ::http::header::CONTENT_LENGTH,
  121    121   
                    content_length,
  122    122   
                );
  123    123   
                builder
  124    124   
                    .status(500)
  125         -
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         125  +
                    .body(::aws_smithy_legacy_http_server::body::to_boxed(payload))?
  126    126   
            }
  127    127   
        }
  128    128   
    })
  129    129   
}

tmp-codegen-diff/codegen-server-test-python/rest_json_extras/rust-server-codegen-python/src/protocol_serde/shape_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_extras/rust-server-codegen-python/src/python_operation_adaptor.rs

@@ -1,1 +601,625 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Python handler for operation `HttpQueryParamsOnlyOperation`.
    3      3   
pub(crate) async fn http_query_params_only_operation(
    4      4   
    input: crate::input::HttpQueryParamsOnlyOperationInput,
    5         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
           5  +
    state: ::aws_smithy_legacy_http_server::Extension<
           6  +
        ::aws_smithy_http_server_python::context::PyContext,
           7  +
    >,
    6      8   
    handler: ::aws_smithy_http_server_python::PyHandler,
    7      9   
) -> std::result::Result<
    8     10   
    crate::output::HttpQueryParamsOnlyOperationOutput,
    9     11   
    crate::error::HttpQueryParamsOnlyOperationError,
   10     12   
> {
   11     13   
    // Async block used to run the handler and catch any Python error.
   12     14   
    let result = if handler.is_coroutine {
   13     15   
        ::tracing::trace!(
   14     16   
            name = "http_query_params_only_operation",
   15     17   
            "executing python handler coroutine"
   16     18   
        );
   17     19   
        let result = ::pyo3::Python::with_gil(|py| {
   18     20   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   19     21   
            let coroutine = if handler.args == 1 {
   20     22   
                pyhandler.call1((input,))?
   21     23   
            } else {
   22     24   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   23     25   
            };
   24     26   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   25     27   
        })?;
   26     28   
        result.await.and_then(|r| {
   27     29   
            ::pyo3::Python::with_gil(|py| {
   28     30   
                r.extract::<crate::output::HttpQueryParamsOnlyOperationOutput>(py)
   29     31   
            })
   30     32   
        })
   31     33   
    } else {
   32     34   
        ::tracing::trace!(
   33     35   
            name = "http_query_params_only_operation",
   34     36   
            "executing python handler function"
   35     37   
        );
   36     38   
        ::pyo3::Python::with_gil(|py| {
   37     39   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   38     40   
            let output = if handler.args == 1 {
   39     41   
                pyhandler.call1((input,))?
   40     42   
            } else {
   41     43   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   42     44   
            };
   43     45   
            output.extract::<crate::output::HttpQueryParamsOnlyOperationOutput>()
   44     46   
        })
   45     47   
    };
   46     48   
    // Catch and record a Python traceback.
   47     49   
    result.map_err(|e| {
   48     50   
        let rich_py_err =
   49     51   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
   50     52   
                e.clone_ref(py)
   51     53   
            }));
   52     54   
        ::tracing::error!(error = ?rich_py_err, "handler error");
   53     55   
        e.into()
   54     56   
    })
   55     57   
}
   56     58   
   57     59   
/// Python handler for operation `QueryPrecedence`.
   58     60   
pub(crate) async fn query_precedence(
   59     61   
    input: crate::input::QueryPrecedenceInput,
   60         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
          62  +
    state: ::aws_smithy_legacy_http_server::Extension<
          63  +
        ::aws_smithy_http_server_python::context::PyContext,
          64  +
    >,
   61     65   
    handler: ::aws_smithy_http_server_python::PyHandler,
   62     66   
) -> std::result::Result<crate::output::QueryPrecedenceOutput, crate::error::QueryPrecedenceError> {
   63     67   
    // Async block used to run the handler and catch any Python error.
   64     68   
    let result = if handler.is_coroutine {
   65     69   
        ::tracing::trace!(
   66     70   
            name = "query_precedence",
   67     71   
            "executing python handler coroutine"
   68     72   
        );
   69     73   
        let result = ::pyo3::Python::with_gil(|py| {
   70     74   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   71     75   
            let coroutine = if handler.args == 1 {
   72     76   
                pyhandler.call1((input,))?
   73     77   
            } else {
   74     78   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   75     79   
            };
   76     80   
            ::pyo3_asyncio::tokio::into_future(coroutine)
   77     81   
        })?;
   78     82   
        result.await.and_then(|r| {
   79     83   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::QueryPrecedenceOutput>(py))
   80     84   
        })
   81     85   
    } else {
   82     86   
        ::tracing::trace!(
   83     87   
            name = "query_precedence",
   84     88   
            "executing python handler function"
   85     89   
        );
   86     90   
        ::pyo3::Python::with_gil(|py| {
   87     91   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
   88     92   
            let output = if handler.args == 1 {
   89     93   
                pyhandler.call1((input,))?
   90     94   
            } else {
   91     95   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
   92     96   
            };
   93     97   
            output.extract::<crate::output::QueryPrecedenceOutput>()
   94     98   
        })
   95     99   
    };
   96    100   
    // Catch and record a Python traceback.
   97    101   
    result.map_err(|e| {
   98    102   
        let rich_py_err =
   99    103   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  100    104   
                e.clone_ref(py)
  101    105   
            }));
  102    106   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  103    107   
        e.into()
  104    108   
    })
  105    109   
}
  106    110   
  107    111   
/// Python handler for operation `EmptyStructWithContentOnWireOp`.
  108    112   
pub(crate) async fn empty_struct_with_content_on_wire_op(
  109    113   
    input: crate::input::EmptyStructWithContentOnWireOpInput,
  110         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         114  +
    state: ::aws_smithy_legacy_http_server::Extension<
         115  +
        ::aws_smithy_http_server_python::context::PyContext,
         116  +
    >,
  111    117   
    handler: ::aws_smithy_http_server_python::PyHandler,
  112    118   
) -> std::result::Result<
  113    119   
    crate::output::EmptyStructWithContentOnWireOpOutput,
  114    120   
    crate::error::EmptyStructWithContentOnWireOpError,
  115    121   
> {
  116    122   
    // Async block used to run the handler and catch any Python error.
  117    123   
    let result = if handler.is_coroutine {
  118    124   
        ::tracing::trace!(
  119    125   
            name = "empty_struct_with_content_on_wire_op",
  120    126   
            "executing python handler coroutine"
  121    127   
        );
  122    128   
        let result = ::pyo3::Python::with_gil(|py| {
  123    129   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  124    130   
            let coroutine = if handler.args == 1 {
  125    131   
                pyhandler.call1((input,))?
  126    132   
            } else {
  127    133   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  128    134   
            };
  129    135   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  130    136   
        })?;
  131    137   
        result.await.and_then(|r| {
  132    138   
            ::pyo3::Python::with_gil(|py| {
  133    139   
                r.extract::<crate::output::EmptyStructWithContentOnWireOpOutput>(py)
  134    140   
            })
  135    141   
        })
  136    142   
    } else {
  137    143   
        ::tracing::trace!(
  138    144   
            name = "empty_struct_with_content_on_wire_op",
  139    145   
            "executing python handler function"
  140    146   
        );
  141    147   
        ::pyo3::Python::with_gil(|py| {
  142    148   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  143    149   
            let output = if handler.args == 1 {
  144    150   
                pyhandler.call1((input,))?
  145    151   
            } else {
  146    152   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  147    153   
            };
  148    154   
            output.extract::<crate::output::EmptyStructWithContentOnWireOpOutput>()
  149    155   
        })
  150    156   
    };
  151    157   
    // Catch and record a Python traceback.
  152    158   
    result.map_err(|e| {
  153    159   
        let rich_py_err =
  154    160   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  155    161   
                e.clone_ref(py)
  156    162   
            }));
  157    163   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  158    164   
        e.into()
  159    165   
    })
  160    166   
}
  161    167   
  162    168   
/// Python handler for operation `CaseInsensitiveErrorOperation`.
  163    169   
pub(crate) async fn case_insensitive_error_operation(
  164    170   
    input: crate::input::CaseInsensitiveErrorOperationInput,
  165         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         171  +
    state: ::aws_smithy_legacy_http_server::Extension<
         172  +
        ::aws_smithy_http_server_python::context::PyContext,
         173  +
    >,
  166    174   
    handler: ::aws_smithy_http_server_python::PyHandler,
  167    175   
) -> std::result::Result<
  168    176   
    crate::output::CaseInsensitiveErrorOperationOutput,
  169    177   
    crate::error::CaseInsensitiveErrorOperationError,
  170    178   
> {
  171    179   
    // Async block used to run the handler and catch any Python error.
  172    180   
    let result = if handler.is_coroutine {
  173    181   
        ::tracing::trace!(
  174    182   
            name = "case_insensitive_error_operation",
  175    183   
            "executing python handler coroutine"
  176    184   
        );
  177    185   
        let result = ::pyo3::Python::with_gil(|py| {
  178    186   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  179    187   
            let coroutine = if handler.args == 1 {
  180    188   
                pyhandler.call1((input,))?
  181    189   
            } else {
  182    190   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  183    191   
            };
  184    192   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  185    193   
        })?;
  186    194   
        result.await.and_then(|r| {
  187    195   
            ::pyo3::Python::with_gil(|py| {
  188    196   
                r.extract::<crate::output::CaseInsensitiveErrorOperationOutput>(py)
  189    197   
            })
  190    198   
        })
  191    199   
    } else {
  192    200   
        ::tracing::trace!(
  193    201   
            name = "case_insensitive_error_operation",
  194    202   
            "executing python handler function"
  195    203   
        );
  196    204   
        ::pyo3::Python::with_gil(|py| {
  197    205   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  198    206   
            let output = if handler.args == 1 {
  199    207   
                pyhandler.call1((input,))?
  200    208   
            } else {
  201    209   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  202    210   
            };
  203    211   
            output.extract::<crate::output::CaseInsensitiveErrorOperationOutput>()
  204    212   
        })
  205    213   
    };
  206    214   
    // Catch and record a Python traceback.
  207    215   
    result.map_err(|e| {
  208    216   
        let rich_py_err =
  209    217   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  210    218   
                e.clone_ref(py)
  211    219   
            }));
  212    220   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  213    221   
        e.into()
  214    222   
    })
  215    223   
}
  216    224   
  217    225   
/// Python handler for operation `NullInNonSparse`.
  218    226   
pub(crate) async fn null_in_non_sparse(
  219    227   
    input: crate::input::NullInNonSparseInput,
  220         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         228  +
    state: ::aws_smithy_legacy_http_server::Extension<
         229  +
        ::aws_smithy_http_server_python::context::PyContext,
         230  +
    >,
  221    231   
    handler: ::aws_smithy_http_server_python::PyHandler,
  222    232   
) -> std::result::Result<crate::output::NullInNonSparseOutput, crate::error::NullInNonSparseError> {
  223    233   
    // Async block used to run the handler and catch any Python error.
  224    234   
    let result = if handler.is_coroutine {
  225    235   
        ::tracing::trace!(
  226    236   
            name = "null_in_non_sparse",
  227    237   
            "executing python handler coroutine"
  228    238   
        );
  229    239   
        let result = ::pyo3::Python::with_gil(|py| {
  230    240   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  231    241   
            let coroutine = if handler.args == 1 {
  232    242   
                pyhandler.call1((input,))?
  233    243   
            } else {
  234    244   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  235    245   
            };
  236    246   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  237    247   
        })?;
  238    248   
        result.await.and_then(|r| {
  239    249   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::NullInNonSparseOutput>(py))
  240    250   
        })
  241    251   
    } else {
  242    252   
        ::tracing::trace!(
  243    253   
            name = "null_in_non_sparse",
  244    254   
            "executing python handler function"
  245    255   
        );
  246    256   
        ::pyo3::Python::with_gil(|py| {
  247    257   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  248    258   
            let output = if handler.args == 1 {
  249    259   
                pyhandler.call1((input,))?
  250    260   
            } else {
  251    261   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  252    262   
            };
  253    263   
            output.extract::<crate::output::NullInNonSparseOutput>()
  254    264   
        })
  255    265   
    };
  256    266   
    // Catch and record a Python traceback.
  257    267   
    result.map_err(|e| {
  258    268   
        let rich_py_err =
  259    269   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  260    270   
                e.clone_ref(py)
  261    271   
            }));
  262    272   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  263    273   
        e.into()
  264    274   
    })
  265    275   
}
  266    276   
  267    277   
/// Python handler for operation `EscapedStringValues`.
  268    278   
pub(crate) async fn escaped_string_values(
  269    279   
    input: crate::input::EscapedStringValuesInput,
  270         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         280  +
    state: ::aws_smithy_legacy_http_server::Extension<
         281  +
        ::aws_smithy_http_server_python::context::PyContext,
         282  +
    >,
  271    283   
    handler: ::aws_smithy_http_server_python::PyHandler,
  272    284   
) -> std::result::Result<
  273    285   
    crate::output::EscapedStringValuesOutput,
  274    286   
    crate::error::EscapedStringValuesError,
  275    287   
> {
  276    288   
    // Async block used to run the handler and catch any Python error.
  277    289   
    let result = if handler.is_coroutine {
  278    290   
        ::tracing::trace!(
  279    291   
            name = "escaped_string_values",
  280    292   
            "executing python handler coroutine"
  281    293   
        );
  282    294   
        let result = ::pyo3::Python::with_gil(|py| {
  283    295   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  284    296   
            let coroutine = if handler.args == 1 {
  285    297   
                pyhandler.call1((input,))?
  286    298   
            } else {
  287    299   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  288    300   
            };
  289    301   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  290    302   
        })?;
  291    303   
        result.await.and_then(|r| {
  292    304   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EscapedStringValuesOutput>(py))
  293    305   
        })
  294    306   
    } else {
  295    307   
        ::tracing::trace!(
  296    308   
            name = "escaped_string_values",
  297    309   
            "executing python handler function"
  298    310   
        );
  299    311   
        ::pyo3::Python::with_gil(|py| {
  300    312   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  301    313   
            let output = if handler.args == 1 {
  302    314   
                pyhandler.call1((input,))?
  303    315   
            } else {
  304    316   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  305    317   
            };
  306    318   
            output.extract::<crate::output::EscapedStringValuesOutput>()
  307    319   
        })
  308    320   
    };
  309    321   
    // Catch and record a Python traceback.
  310    322   
    result.map_err(|e| {
  311    323   
        let rich_py_err =
  312    324   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  313    325   
                e.clone_ref(py)
  314    326   
            }));
  315    327   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  316    328   
        e.into()
  317    329   
    })
  318    330   
}
  319    331   
  320    332   
/// Python handler for operation `PrimitiveIntOp`.
  321    333   
pub(crate) async fn primitive_int_op(
  322    334   
    input: crate::input::PrimitiveIntOpInput,
  323         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         335  +
    state: ::aws_smithy_legacy_http_server::Extension<
         336  +
        ::aws_smithy_http_server_python::context::PyContext,
         337  +
    >,
  324    338   
    handler: ::aws_smithy_http_server_python::PyHandler,
  325    339   
) -> std::result::Result<crate::output::PrimitiveIntOpOutput, crate::error::PrimitiveIntOpError> {
  326    340   
    // Async block used to run the handler and catch any Python error.
  327    341   
    let result = if handler.is_coroutine {
  328    342   
        ::tracing::trace!(
  329    343   
            name = "primitive_int_op",
  330    344   
            "executing python handler coroutine"
  331    345   
        );
  332    346   
        let result = ::pyo3::Python::with_gil(|py| {
  333    347   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  334    348   
            let coroutine = if handler.args == 1 {
  335    349   
                pyhandler.call1((input,))?
  336    350   
            } else {
  337    351   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  338    352   
            };
  339    353   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  340    354   
        })?;
  341    355   
        result.await.and_then(|r| {
  342    356   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::PrimitiveIntOpOutput>(py))
  343    357   
        })
  344    358   
    } else {
  345    359   
        ::tracing::trace!(
  346    360   
            name = "primitive_int_op",
  347    361   
            "executing python handler function"
  348    362   
        );
  349    363   
        ::pyo3::Python::with_gil(|py| {
  350    364   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  351    365   
            let output = if handler.args == 1 {
  352    366   
                pyhandler.call1((input,))?
  353    367   
            } else {
  354    368   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  355    369   
            };
  356    370   
            output.extract::<crate::output::PrimitiveIntOpOutput>()
  357    371   
        })
  358    372   
    };
  359    373   
    // Catch and record a Python traceback.
  360    374   
    result.map_err(|e| {
  361    375   
        let rich_py_err =
  362    376   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  363    377   
                e.clone_ref(py)
  364    378   
            }));
  365    379   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  366    380   
        e.into()
  367    381   
    })
  368    382   
}
  369    383   
  370    384   
/// Python handler for operation `MapWithEnumKeyOp`.
  371    385   
pub(crate) async fn map_with_enum_key_op(
  372    386   
    input: crate::input::MapWithEnumKeyOpInput,
  373         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         387  +
    state: ::aws_smithy_legacy_http_server::Extension<
         388  +
        ::aws_smithy_http_server_python::context::PyContext,
         389  +
    >,
  374    390   
    handler: ::aws_smithy_http_server_python::PyHandler,
  375    391   
) -> std::result::Result<crate::output::MapWithEnumKeyOpOutput, crate::error::MapWithEnumKeyOpError>
  376    392   
{
  377    393   
    // Async block used to run the handler and catch any Python error.
  378    394   
    let result = if handler.is_coroutine {
  379    395   
        ::tracing::trace!(
  380    396   
            name = "map_with_enum_key_op",
  381    397   
            "executing python handler coroutine"
  382    398   
        );
  383    399   
        let result = ::pyo3::Python::with_gil(|py| {
  384    400   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  385    401   
            let coroutine = if handler.args == 1 {
  386    402   
                pyhandler.call1((input,))?
  387    403   
            } else {
  388    404   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  389    405   
            };
  390    406   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  391    407   
        })?;
  392    408   
        result.await.and_then(|r| {
  393    409   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::MapWithEnumKeyOpOutput>(py))
  394    410   
        })
  395    411   
    } else {
  396    412   
        ::tracing::trace!(
  397    413   
            name = "map_with_enum_key_op",
  398    414   
            "executing python handler function"
  399    415   
        );
  400    416   
        ::pyo3::Python::with_gil(|py| {
  401    417   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  402    418   
            let output = if handler.args == 1 {
  403    419   
                pyhandler.call1((input,))?
  404    420   
            } else {
  405    421   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  406    422   
            };
  407    423   
            output.extract::<crate::output::MapWithEnumKeyOpOutput>()
  408    424   
        })
  409    425   
    };
  410    426   
    // Catch and record a Python traceback.
  411    427   
    result.map_err(|e| {
  412    428   
        let rich_py_err =
  413    429   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  414    430   
                e.clone_ref(py)
  415    431   
            }));
  416    432   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  417    433   
        e.into()
  418    434   
    })
  419    435   
}
  420    436   
  421    437   
/// Python handler for operation `StatusResponse`.
  422    438   
pub(crate) async fn status_response(
  423    439   
    input: crate::input::StatusResponseInput,
  424         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         440  +
    state: ::aws_smithy_legacy_http_server::Extension<
         441  +
        ::aws_smithy_http_server_python::context::PyContext,
         442  +
    >,
  425    443   
    handler: ::aws_smithy_http_server_python::PyHandler,
  426    444   
) -> std::result::Result<crate::output::StatusResponseOutput, crate::error::StatusResponseError> {
  427    445   
    // Async block used to run the handler and catch any Python error.
  428    446   
    let result = if handler.is_coroutine {
  429    447   
        ::tracing::trace!(
  430    448   
            name = "status_response",
  431    449   
            "executing python handler coroutine"
  432    450   
        );
  433    451   
        let result = ::pyo3::Python::with_gil(|py| {
  434    452   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  435    453   
            let coroutine = if handler.args == 1 {
  436    454   
                pyhandler.call1((input,))?
  437    455   
            } else {
  438    456   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  439    457   
            };
  440    458   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  441    459   
        })?;
  442    460   
        result.await.and_then(|r| {
  443    461   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::StatusResponseOutput>(py))
  444    462   
        })
  445    463   
    } else {
  446    464   
        ::tracing::trace!(
  447    465   
            name = "status_response",
  448    466   
            "executing python handler function"
  449    467   
        );
  450    468   
        ::pyo3::Python::with_gil(|py| {
  451    469   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  452    470   
            let output = if handler.args == 1 {
  453    471   
                pyhandler.call1((input,))?
  454    472   
            } else {
  455    473   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  456    474   
            };
  457    475   
            output.extract::<crate::output::StatusResponseOutput>()
  458    476   
        })
  459    477   
    };
  460    478   
    // Catch and record a Python traceback.
  461    479   
    result.map_err(|e| {
  462    480   
        let rich_py_err =
  463    481   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  464    482   
                e.clone_ref(py)
  465    483   
            }));
  466    484   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  467    485   
        e.into()
  468    486   
    })
  469    487   
}
  470    488   
  471    489   
/// Python handler for operation `EnumQuery`.
  472    490   
pub(crate) async fn enum_query(
  473    491   
    input: crate::input::EnumQueryInput,
  474         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         492  +
    state: ::aws_smithy_legacy_http_server::Extension<
         493  +
        ::aws_smithy_http_server_python::context::PyContext,
         494  +
    >,
  475    495   
    handler: ::aws_smithy_http_server_python::PyHandler,
  476    496   
) -> std::result::Result<crate::output::EnumQueryOutput, crate::error::EnumQueryError> {
  477    497   
    // Async block used to run the handler and catch any Python error.
  478    498   
    let result = if handler.is_coroutine {
  479    499   
        ::tracing::trace!(name = "enum_query", "executing python handler coroutine");
  480    500   
        let result = ::pyo3::Python::with_gil(|py| {
  481    501   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  482    502   
            let coroutine = if handler.args == 1 {
  483    503   
                pyhandler.call1((input,))?
  484    504   
            } else {
  485    505   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  486    506   
            };
  487    507   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  488    508   
        })?;
  489    509   
        result.await.and_then(|r| {
  490    510   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::EnumQueryOutput>(py))
  491    511   
        })
  492    512   
    } else {
  493    513   
        ::tracing::trace!(name = "enum_query", "executing python handler function");
  494    514   
        ::pyo3::Python::with_gil(|py| {
  495    515   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  496    516   
            let output = if handler.args == 1 {
  497    517   
                pyhandler.call1((input,))?
  498    518   
            } else {
  499    519   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  500    520   
            };
  501    521   
            output.extract::<crate::output::EnumQueryOutput>()
  502    522   
        })
  503    523   
    };
  504    524   
    // Catch and record a Python traceback.
  505    525   
    result.map_err(|e| {
  506    526   
        let rich_py_err =
  507    527   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  508    528   
                e.clone_ref(py)
  509    529   
            }));
  510    530   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  511    531   
        e.into()
  512    532   
    })
  513    533   
}
  514    534   
  515    535   
/// Python handler for operation `PrimitiveIntHeader`.
  516    536   
pub(crate) async fn primitive_int_header(
  517    537   
    input: crate::input::PrimitiveIntHeaderInput,
  518         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         538  +
    state: ::aws_smithy_legacy_http_server::Extension<
         539  +
        ::aws_smithy_http_server_python::context::PyContext,
         540  +
    >,
  519    541   
    handler: ::aws_smithy_http_server_python::PyHandler,
  520    542   
) -> std::result::Result<
  521    543   
    crate::output::PrimitiveIntHeaderOutput,
  522    544   
    crate::error::PrimitiveIntHeaderError,
  523    545   
> {
  524    546   
    // Async block used to run the handler and catch any Python error.
  525    547   
    let result = if handler.is_coroutine {
  526    548   
        ::tracing::trace!(
  527    549   
            name = "primitive_int_header",
  528    550   
            "executing python handler coroutine"
  529    551   
        );
  530    552   
        let result = ::pyo3::Python::with_gil(|py| {
  531    553   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  532    554   
            let coroutine = if handler.args == 1 {
  533    555   
                pyhandler.call1((input,))?
  534    556   
            } else {
  535    557   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  536    558   
            };
  537    559   
            ::pyo3_asyncio::tokio::into_future(coroutine)
  538    560   
        })?;
  539    561   
        result.await.and_then(|r| {
  540    562   
            ::pyo3::Python::with_gil(|py| r.extract::<crate::output::PrimitiveIntHeaderOutput>(py))
  541    563   
        })
  542    564   
    } else {
  543    565   
        ::tracing::trace!(
  544    566   
            name = "primitive_int_header",
  545    567   
            "executing python handler function"
  546    568   
        );
  547    569   
        ::pyo3::Python::with_gil(|py| {
  548    570   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;
  549    571   
            let output = if handler.args == 1 {
  550    572   
                pyhandler.call1((input,))?
  551    573   
            } else {
  552    574   
                pyhandler.call1((input, ::pyo3::ToPyObject::to_object(&state.0, py)))?
  553    575   
            };
  554    576   
            output.extract::<crate::output::PrimitiveIntHeaderOutput>()
  555    577   
        })
  556    578   
    };
  557    579   
    // Catch and record a Python traceback.
  558    580   
    result.map_err(|e| {
  559    581   
        let rich_py_err =
  560    582   
            ::aws_smithy_http_server_python::rich_py_err(::pyo3::Python::with_gil(|py| {
  561    583   
                e.clone_ref(py)
  562    584   
            }));
  563    585   
        ::tracing::error!(error = ?rich_py_err, "handler error");
  564    586   
        e.into()
  565    587   
    })
  566    588   
}
  567    589   
  568    590   
/// Python handler for operation `StringPayload`.
  569    591   
pub(crate) async fn string_payload(
  570    592   
    input: crate::input::StringPayloadInput,
  571         -
    state: ::aws_smithy_http_server::Extension<::aws_smithy_http_server_python::context::PyContext>,
         593  +
    state: ::aws_smithy_legacy_http_server::Extension<
         594  +
        ::aws_smithy_http_server_python::context::PyContext,
         595  +
    >,
  572    596   
    handler: ::aws_smithy_http_server_python::PyHandler,
  573    597   
) -> std::result::Result<crate::output::StringPayloadOutput, crate::error::StringPayloadError> {
  574    598   
    // Async block used to run the handler and catch any Python error.
  575    599   
    let result = if handler.is_coroutine {
  576    600   
        ::tracing::trace!(
  577    601   
            name = "string_payload",
  578    602   
            "executing python handler coroutine"
  579    603   
        );
  580    604   
        let result = ::pyo3::Python::with_gil(|py| {
  581    605   
            let pyhandler: &::pyo3::types::PyFunction = handler.extract(py)?;