Server Test

Server Test

rev. 03e6e47f15dfd569240d570d98975ebba692c405

Files changed:

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_content_type_parameters.rs

@@ -1,1 +91,94 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_content_type_parameters_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::ContentTypeParametersInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::content_type_parameters_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input =
   29     32   
                crate::protocol_serde::shape_content_type_parameters::de_content_type_parameters(
   30     33   
                    bytes.as_ref(),
   31     34   
                    input,
   32     35   
                )?;
   33     36   
        }
   34     37   
        input.build()
   35     38   
    })
   36     39   
}
   37     40   
   38     41   
#[allow(clippy::unnecessary_wraps)]
   39     42   
pub fn ser_content_type_parameters_http_response(
   40     43   
    #[allow(unused_variables)] output: crate::output::ContentTypeParametersOutput,
   41     44   
) -> std::result::Result<
   42     45   
    ::aws_smithy_http_server::response::Response,
   43     46   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   44     47   
> {
   45     48   
    Ok({
   46     49   
        #[allow(unused_mut)]
   47         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   48     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     52   
            builder,
   50         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   51     54   
            "application/x-amz-json-1.0",
   52     55   
        );
   53     56   
        let http_status: u16 = 200;
   54     57   
        builder = builder.status(http_status);
   55     58   
        let payload =
   56     59   
            crate::protocol_serde::shape_content_type_parameters_output::ser_content_type_parameters_output_output_output(&output)?
   57     60   
        ;
   58     61   
        let content_length = payload.len();
   59     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     63   
            builder,
   61         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   62     65   
            content_length,
   63     66   
        );
   64     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   65     68   
        builder.body(body)?
   66     69   
    })
   67     70   
}
   68     71   
   69     72   
pub(crate) fn de_content_type_parameters(
   70     73   
    value: &[u8],
   71     74   
    mut builder: crate::input::content_type_parameters_input::Builder,

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_empty_input_and_empty_output.rs

@@ -1,1 +55,55 @@
    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_input_and_empty_output_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EmptyInputAndEmptyOutputInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::empty_input_and_empty_output_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_empty_input_and_empty_output_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::EmptyInputAndEmptyOutputOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload =
   44     44   
            crate::protocol_serde::shape_empty_input_and_empty_output_output::ser_empty_input_and_empty_output_output_output_output(&output)?
   45     45   
        ;
   46     46   
        let content_length = payload.len();
   47     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49         -
            ::http::header::CONTENT_LENGTH,
          49  +
            ::http_1x::header::CONTENT_LENGTH,
   50     50   
            content_length,
   51     51   
        );
   52     52   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   53     53   
        builder.body(body)?
   54     54   
    })
   55     55   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_endpoint_operation.rs

@@ -1,1 +53,53 @@
    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_endpoint_operation_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EndpointOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::endpoint_operation_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_endpoint_operation_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::EndpointOperationOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload = "";
   44     44   
        let content_length = payload.len();
   45     45   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47         -
            ::http::header::CONTENT_LENGTH,
          47  +
            ::http_1x::header::CONTENT_LENGTH,
   48     48   
            content_length,
   49     49   
        );
   50     50   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   51     51   
        builder.body(body)?
   52     52   
    })
   53     53   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_endpoint_with_host_label_operation.rs

@@ -1,1 +114,117 @@
    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_endpoint_with_host_label_operation_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::EndpointWithHostLabelOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::endpoint_with_host_label_operation_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_endpoint_with_host_label_operation::de_endpoint_with_host_label_operation(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()?
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_endpoint_with_host_label_operation_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::EndpointWithHostLabelOperationOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.0",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload = "";
   52     55   
        let content_length = payload.len();
   53     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     57   
            builder,
   55         -
            ::http::header::CONTENT_LENGTH,
          58  +
            ::http_1x::header::CONTENT_LENGTH,
   56     59   
            content_length,
   57     60   
        );
   58     61   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   59     62   
        builder.body(body)?
   60     63   
    })
   61     64   
}
   62     65   
   63     66   
#[allow(clippy::unnecessary_wraps)]
   64     67   
pub fn ser_endpoint_with_host_label_operation_http_error(
   65     68   
    error: &crate::error::EndpointWithHostLabelOperationError,
   66     69   
) -> std::result::Result<
   67     70   
    ::aws_smithy_http_server::response::Response,
   68     71   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   69     72   
> {
   70     73   
    Ok({
   71     74   
        match error {
   72     75   
            crate::error::EndpointWithHostLabelOperationError::ValidationException(output) => {
   73     76   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   74     77   
                #[allow(unused_mut)]
   75         -
                let mut builder = ::http::Response::builder();
          78  +
                let mut builder = ::http_1x::Response::builder();
   76     79   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   77     80   
                    builder,
   78         -
                    ::http::header::CONTENT_TYPE,
          81  +
                    ::http_1x::header::CONTENT_TYPE,
   79     82   
                    "application/x-amz-json-1.0",
   80     83   
                );
   81     84   
                let content_length = payload.len();
   82     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     86   
                    builder,
   84         -
                    ::http::header::CONTENT_LENGTH,
          87  +
                    ::http_1x::header::CONTENT_LENGTH,
   85     88   
                    content_length,
   86     89   
                );
   87     90   
                builder
   88     91   
                    .status(400)
   89     92   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   90     93   
            }
   91     94   
        }
   92     95   
    })
   93     96   
}
   94     97   

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_greeting_with_errors.rs

@@ -1,1 +161,164 @@
    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_greeting_with_errors_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::GreetingWithErrorsInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::greeting_with_errors_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_greeting_with_errors::de_greeting_with_errors(
   29     32   
                bytes.as_ref(),
   30     33   
                input,
   31     34   
            )?;
   32     35   
        }
   33     36   
        input.build()
   34     37   
    })
   35     38   
}
   36     39   
   37     40   
#[allow(clippy::unnecessary_wraps)]
   38     41   
pub fn ser_greeting_with_errors_http_response(
   39     42   
    #[allow(unused_variables)] output: crate::output::GreetingWithErrorsOutput,
   40     43   
) -> std::result::Result<
   41     44   
    ::aws_smithy_http_server::response::Response,
   42     45   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   43     46   
> {
   44     47   
    Ok({
   45     48   
        #[allow(unused_mut)]
   46         -
        let mut builder = ::http::Response::builder();
          49  +
        let mut builder = ::http_1x::Response::builder();
   47     50   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     51   
            builder,
   49         -
            ::http::header::CONTENT_TYPE,
          52  +
            ::http_1x::header::CONTENT_TYPE,
   50     53   
            "application/x-amz-json-1.0",
   51     54   
        );
   52     55   
        let http_status: u16 = 200;
   53     56   
        builder = builder.status(http_status);
   54     57   
        let payload =
   55     58   
            crate::protocol_serde::shape_greeting_with_errors_output::ser_greeting_with_errors_output_output_output(&output)?
   56     59   
        ;
   57     60   
        let content_length = payload.len();
   58     61   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     62   
            builder,
   60         -
            ::http::header::CONTENT_LENGTH,
          63  +
            ::http_1x::header::CONTENT_LENGTH,
   61     64   
            content_length,
   62     65   
        );
   63     66   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   64     67   
        builder.body(body)?
   65     68   
    })
   66     69   
}
   67     70   
   68     71   
#[allow(clippy::unnecessary_wraps)]
   69     72   
pub fn ser_greeting_with_errors_http_error(
   70     73   
    error: &crate::error::GreetingWithErrorsError,
   71     74   
) -> std::result::Result<
   72     75   
    ::aws_smithy_http_server::response::Response,
   73     76   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   74     77   
> {
   75     78   
    Ok({
   76     79   
        match error {
   77     80   
            crate::error::GreetingWithErrorsError::InvalidGreeting(output) => {
   78     81   
                let payload =
   79     82   
                    crate::protocol_serde::shape_invalid_greeting::ser_invalid_greeting_error(
   80     83   
                        output,
   81     84   
                    )?;
   82     85   
                #[allow(unused_mut)]
   83         -
                let mut builder = ::http::Response::builder();
          86  +
                let mut builder = ::http_1x::Response::builder();
   84     87   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     88   
                    builder,
   86         -
                    ::http::header::CONTENT_TYPE,
          89  +
                    ::http_1x::header::CONTENT_TYPE,
   87     90   
                    "application/x-amz-json-1.0",
   88     91   
                );
   89     92   
                let content_length = payload.len();
   90     93   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91     94   
                    builder,
   92         -
                    ::http::header::CONTENT_LENGTH,
          95  +
                    ::http_1x::header::CONTENT_LENGTH,
   93     96   
                    content_length,
   94     97   
                );
   95     98   
                builder
   96     99   
                    .status(400)
   97    100   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   98    101   
            }
   99    102   
            crate::error::GreetingWithErrorsError::ComplexError(output) => {
  100    103   
                let payload =
  101    104   
                    crate::protocol_serde::shape_complex_error::ser_complex_error_error(output)?;
  102    105   
                #[allow(unused_mut)]
  103         -
                let mut builder = ::http::Response::builder();
         106  +
                let mut builder = ::http_1x::Response::builder();
  104    107   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  105    108   
                    builder,
  106         -
                    ::http::header::CONTENT_TYPE,
         109  +
                    ::http_1x::header::CONTENT_TYPE,
  107    110   
                    "application/x-amz-json-1.0",
  108    111   
                );
  109    112   
                let content_length = payload.len();
  110    113   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  111    114   
                    builder,
  112         -
                    ::http::header::CONTENT_LENGTH,
         115  +
                    ::http_1x::header::CONTENT_LENGTH,
  113    116   
                    content_length,
  114    117   
                );
  115    118   
                builder
  116    119   
                    .status(400)
  117    120   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  118    121   
            }
  119    122   
            crate::error::GreetingWithErrorsError::FooError(output) => {
  120    123   
                let payload = crate::protocol_serde::shape_foo_error::ser_foo_error_error(output)?;
  121    124   
                #[allow(unused_mut)]
  122         -
                let mut builder = ::http::Response::builder();
         125  +
                let mut builder = ::http_1x::Response::builder();
  123    126   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  124    127   
                    builder,
  125         -
                    ::http::header::CONTENT_TYPE,
         128  +
                    ::http_1x::header::CONTENT_TYPE,
  126    129   
                    "application/x-amz-json-1.0",
  127    130   
                );
  128    131   
                let content_length = payload.len();
  129    132   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  130    133   
                    builder,
  131         -
                    ::http::header::CONTENT_LENGTH,
         134  +
                    ::http_1x::header::CONTENT_LENGTH,
  132    135   
                    content_length,
  133    136   
                );
  134    137   
                builder
  135    138   
                    .status(500)
  136    139   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
  137    140   
            }
  138    141   
        }
  139    142   
    })
  140    143   
}
  141    144   

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_host_with_path_operation.rs

@@ -1,1 +53,53 @@
    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_host_with_path_operation_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::HostWithPathOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::host_with_path_operation_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_host_with_path_operation_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::HostWithPathOperationOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload = "";
   44     44   
        let content_length = payload.len();
   45     45   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47         -
            ::http::header::CONTENT_LENGTH,
          47  +
            ::http_1x::header::CONTENT_LENGTH,
   48     48   
            content_length,
   49     49   
        );
   50     50   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   51     51   
        builder.body(body)?
   52     52   
    })
   53     53   
}

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

@@ -1,1 +118,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_json_unions_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::JsonUnionsInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::json_unions_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input =
   29     32   
                crate::protocol_serde::shape_json_unions::de_json_unions(bytes.as_ref(), input)?;
   30     33   
        }
   31     34   
        input.build()?
   32     35   
    })
   33     36   
}
   34     37   
   35     38   
#[allow(clippy::unnecessary_wraps)]
   36     39   
pub fn ser_json_unions_http_response(
   37     40   
    #[allow(unused_variables)] output: crate::output::JsonUnionsOutput,
   38     41   
) -> std::result::Result<
   39     42   
    ::aws_smithy_http_server::response::Response,
   40     43   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   41     44   
> {
   42     45   
    Ok({
   43     46   
        #[allow(unused_mut)]
   44         -
        let mut builder = ::http::Response::builder();
          47  +
        let mut builder = ::http_1x::Response::builder();
   45     48   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     49   
            builder,
   47         -
            ::http::header::CONTENT_TYPE,
          50  +
            ::http_1x::header::CONTENT_TYPE,
   48     51   
            "application/x-amz-json-1.0",
   49     52   
        );
   50     53   
        let http_status: u16 = 200;
   51     54   
        builder = builder.status(http_status);
   52     55   
        let payload =
   53     56   
            crate::protocol_serde::shape_json_unions_output::ser_json_unions_output_output_output(
   54     57   
                &output,
   55     58   
            )?;
   56     59   
        let content_length = payload.len();
   57     60   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   58     61   
            builder,
   59         -
            ::http::header::CONTENT_LENGTH,
          62  +
            ::http_1x::header::CONTENT_LENGTH,
   60     63   
            content_length,
   61     64   
        );
   62     65   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   63     66   
        builder.body(body)?
   64     67   
    })
   65     68   
}
   66     69   
   67     70   
#[allow(clippy::unnecessary_wraps)]
   68     71   
pub fn ser_json_unions_http_error(
   69     72   
    error: &crate::error::JsonUnionsError,
   70     73   
) -> std::result::Result<
   71     74   
    ::aws_smithy_http_server::response::Response,
   72     75   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   73     76   
> {
   74     77   
    Ok({
   75     78   
        match error {
   76     79   
            crate::error::JsonUnionsError::ValidationException(output) => {
   77     80   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   78     81   
                #[allow(unused_mut)]
   79         -
                let mut builder = ::http::Response::builder();
          82  +
                let mut builder = ::http_1x::Response::builder();
   80     83   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   81     84   
                    builder,
   82         -
                    ::http::header::CONTENT_TYPE,
          85  +
                    ::http_1x::header::CONTENT_TYPE,
   83     86   
                    "application/x-amz-json-1.0",
   84     87   
                );
   85     88   
                let content_length = payload.len();
   86     89   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87     90   
                    builder,
   88         -
                    ::http::header::CONTENT_LENGTH,
          91  +
                    ::http_1x::header::CONTENT_LENGTH,
   89     92   
                    content_length,
   90     93   
                );
   91     94   
                builder
   92     95   
                    .status(400)
   93     96   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   94     97   
            }
   95     98   
        }
   96     99   
    })
   97    100   
}
   98    101   

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_no_input_and_no_output.rs

@@ -1,1 +53,53 @@
    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_no_input_and_no_output_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::NoInputAndNoOutputInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::no_input_and_no_output_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_no_input_and_no_output_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::NoInputAndNoOutputOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload = "";
   44     44   
        let content_length = payload.len();
   45     45   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47         -
            ::http::header::CONTENT_LENGTH,
          47  +
            ::http_1x::header::CONTENT_LENGTH,
   48     48   
            content_length,
   49     49   
        );
   50     50   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   51     51   
        builder.body(body)?
   52     52   
    })
   53     53   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_no_input_and_output.rs

@@ -1,1 +55,55 @@
    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_no_input_and_output_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::NoInputAndOutputInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::no_input_and_output_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_no_input_and_output_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::NoInputAndOutputOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload =
   44     44   
            crate::protocol_serde::shape_no_input_and_output_output::ser_no_input_and_output_output_output_output(&output)?
   45     45   
        ;
   46     46   
        let content_length = payload.len();
   47     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49         -
            ::http::header::CONTENT_LENGTH,
          49  +
            ::http_1x::header::CONTENT_LENGTH,
   50     50   
            content_length,
   51     51   
        );
   52     52   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   53     53   
        builder.body(body)?
   54     54   
    })
   55     55   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_operation_with_defaults.rs

@@ -1,1 +120,123 @@
    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_operation_with_defaults_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OperationWithDefaultsInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::operation_with_defaults_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input =
   29     32   
                crate::protocol_serde::shape_operation_with_defaults::de_operation_with_defaults(
   30     33   
                    bytes.as_ref(),
   31     34   
                    input,
   32     35   
                )?;
   33     36   
        }
   34     37   
        input.build()?
   35     38   
    })
   36     39   
}
   37     40   
   38     41   
#[allow(clippy::unnecessary_wraps)]
   39     42   
pub fn ser_operation_with_defaults_http_response(
   40     43   
    #[allow(unused_variables)] output: crate::output::OperationWithDefaultsOutput,
   41     44   
) -> std::result::Result<
   42     45   
    ::aws_smithy_http_server::response::Response,
   43     46   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   44     47   
> {
   45     48   
    Ok({
   46     49   
        #[allow(unused_mut)]
   47         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   48     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     52   
            builder,
   50         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   51     54   
            "application/x-amz-json-1.0",
   52     55   
        );
   53     56   
        let http_status: u16 = 200;
   54     57   
        builder = builder.status(http_status);
   55     58   
        let payload =
   56     59   
            crate::protocol_serde::shape_operation_with_defaults_output::ser_operation_with_defaults_output_output_output(&output)?
   57     60   
        ;
   58     61   
        let content_length = payload.len();
   59     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     63   
            builder,
   61         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   62     65   
            content_length,
   63     66   
        );
   64     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   65     68   
        builder.body(body)?
   66     69   
    })
   67     70   
}
   68     71   
   69     72   
#[allow(clippy::unnecessary_wraps)]
   70     73   
pub fn ser_operation_with_defaults_http_error(
   71     74   
    error: &crate::error::OperationWithDefaultsError,
   72     75   
) -> std::result::Result<
   73     76   
    ::aws_smithy_http_server::response::Response,
   74     77   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   75     78   
> {
   76     79   
    Ok({
   77     80   
        match error {
   78     81   
            crate::error::OperationWithDefaultsError::ValidationException(output) => {
   79     82   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   80     83   
                #[allow(unused_mut)]
   81         -
                let mut builder = ::http::Response::builder();
          84  +
                let mut builder = ::http_1x::Response::builder();
   82     85   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   83     86   
                    builder,
   84         -
                    ::http::header::CONTENT_TYPE,
          87  +
                    ::http_1x::header::CONTENT_TYPE,
   85     88   
                    "application/x-amz-json-1.0",
   86     89   
                );
   87     90   
                let content_length = payload.len();
   88     91   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   89     92   
                    builder,
   90         -
                    ::http::header::CONTENT_LENGTH,
          93  +
                    ::http_1x::header::CONTENT_LENGTH,
   91     94   
                    content_length,
   92     95   
                );
   93     96   
                builder
   94     97   
                    .status(400)
   95     98   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   96     99   
            }
   97    100   
        }
   98    101   
    })
   99    102   
}
  100    103   

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_operation_with_nested_structure.rs

@@ -1,1 +116,119 @@
    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_operation_with_nested_structure_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OperationWithNestedStructureInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::operation_with_nested_structure_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_operation_with_nested_structure::de_operation_with_nested_structure(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()?
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_operation_with_nested_structure_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::OperationWithNestedStructureOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.0",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload =
   52     55   
            crate::protocol_serde::shape_operation_with_nested_structure_output::ser_operation_with_nested_structure_output_output_output(&output)?
   53     56   
        ;
   54     57   
        let content_length = payload.len();
   55     58   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   56     59   
            builder,
   57         -
            ::http::header::CONTENT_LENGTH,
          60  +
            ::http_1x::header::CONTENT_LENGTH,
   58     61   
            content_length,
   59     62   
        );
   60     63   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   61     64   
        builder.body(body)?
   62     65   
    })
   63     66   
}
   64     67   
   65     68   
#[allow(clippy::unnecessary_wraps)]
   66     69   
pub fn ser_operation_with_nested_structure_http_error(
   67     70   
    error: &crate::error::OperationWithNestedStructureError,
   68     71   
) -> std::result::Result<
   69     72   
    ::aws_smithy_http_server::response::Response,
   70     73   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   71     74   
> {
   72     75   
    Ok({
   73     76   
        match error {
   74     77   
            crate::error::OperationWithNestedStructureError::ValidationException(output) => {
   75     78   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
   76     79   
                #[allow(unused_mut)]
   77         -
                let mut builder = ::http::Response::builder();
          80  +
                let mut builder = ::http_1x::Response::builder();
   78     81   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     82   
                    builder,
   80         -
                    ::http::header::CONTENT_TYPE,
          83  +
                    ::http_1x::header::CONTENT_TYPE,
   81     84   
                    "application/x-amz-json-1.0",
   82     85   
                );
   83     86   
                let content_length = payload.len();
   84     87   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85     88   
                    builder,
   86         -
                    ::http::header::CONTENT_LENGTH,
          89  +
                    ::http_1x::header::CONTENT_LENGTH,
   87     90   
                    content_length,
   88     91   
                );
   89     92   
                builder
   90     93   
                    .status(400)
   91     94   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
   92     95   
            }
   93     96   
        }
   94     97   
    })
   95     98   
}
   96     99   

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_operation_with_required_members.rs

@@ -1,1 +55,55 @@
    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_operation_with_required_members_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OperationWithRequiredMembersInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::operation_with_required_members_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_operation_with_required_members_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::OperationWithRequiredMembersOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload =
   44     44   
            crate::protocol_serde::shape_operation_with_required_members_output::ser_operation_with_required_members_output_output_output(&output)?
   45     45   
        ;
   46     46   
        let content_length = payload.len();
   47     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     48   
            builder,
   49         -
            ::http::header::CONTENT_LENGTH,
          49  +
            ::http_1x::header::CONTENT_LENGTH,
   50     50   
            content_length,
   51     51   
        );
   52     52   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   53     53   
        builder.body(body)?
   54     54   
    })
   55     55   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_operation_with_required_members_with_defaults.rs

@@ -1,1 +57,57 @@
    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_operation_with_required_members_with_defaults_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::OperationWithRequiredMembersWithDefaultsInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input =
   18     18   
            crate::input::operation_with_required_members_with_defaults_input::Builder::default();
   19     19   
        #[allow(unused_variables)]
   20     20   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     21   
            uri, headers, body, ..
   22     22   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
   23     23   
        input.build()
   24     24   
    })
   25     25   
}
   26     26   
   27     27   
#[allow(clippy::unnecessary_wraps)]
   28     28   
pub fn ser_operation_with_required_members_with_defaults_http_response(
   29     29   
    #[allow(unused_variables)]
   30     30   
    output: crate::output::OperationWithRequiredMembersWithDefaultsOutput,
   31     31   
) -> std::result::Result<
   32     32   
    ::aws_smithy_http_server::response::Response,
   33     33   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   34     34   
> {
   35     35   
    Ok({
   36     36   
        #[allow(unused_mut)]
   37         -
        let mut builder = ::http::Response::builder();
          37  +
        let mut builder = ::http_1x::Response::builder();
   38     38   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   39     39   
            builder,
   40         -
            ::http::header::CONTENT_TYPE,
          40  +
            ::http_1x::header::CONTENT_TYPE,
   41     41   
            "application/x-amz-json-1.0",
   42     42   
        );
   43     43   
        let http_status: u16 = 200;
   44     44   
        builder = builder.status(http_status);
   45     45   
        let payload =
   46     46   
            crate::protocol_serde::shape_operation_with_required_members_with_defaults_output::ser_operation_with_required_members_with_defaults_output_output_output(&output)?
   47     47   
        ;
   48     48   
        let content_length = payload.len();
   49     49   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     50   
            builder,
   51         -
            ::http::header::CONTENT_LENGTH,
          51  +
            ::http_1x::header::CONTENT_LENGTH,
   52     52   
            content_length,
   53     53   
        );
   54     54   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   55     55   
        builder.body(body)?
   56     56   
    })
   57     57   
}

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_put_with_content_encoding.rs

@@ -1,1 +85,88 @@
    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_put_with_content_encoding_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::PutWithContentEncodingInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::put_with_content_encoding_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input = crate::protocol_serde::shape_put_with_content_encoding::de_put_with_content_encoding(bytes.as_ref(), input)?;
   29     32   
        }
   30     33   
        input.build()
   31     34   
    })
   32     35   
}
   33     36   
   34     37   
#[allow(clippy::unnecessary_wraps)]
   35     38   
pub fn ser_put_with_content_encoding_http_response(
   36     39   
    #[allow(unused_variables)] output: crate::output::PutWithContentEncodingOutput,
   37     40   
) -> std::result::Result<
   38     41   
    ::aws_smithy_http_server::response::Response,
   39     42   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     43   
> {
   41     44   
    Ok({
   42     45   
        #[allow(unused_mut)]
   43         -
        let mut builder = ::http::Response::builder();
          46  +
        let mut builder = ::http_1x::Response::builder();
   44     47   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     48   
            builder,
   46         -
            ::http::header::CONTENT_TYPE,
          49  +
            ::http_1x::header::CONTENT_TYPE,
   47     50   
            "application/x-amz-json-1.0",
   48     51   
        );
   49     52   
        let http_status: u16 = 200;
   50     53   
        builder = builder.status(http_status);
   51     54   
        let payload = "";
   52     55   
        let content_length = payload.len();
   53     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     57   
            builder,
   55         -
            ::http::header::CONTENT_LENGTH,
          58  +
            ::http_1x::header::CONTENT_LENGTH,
   56     59   
            content_length,
   57     60   
        );
   58     61   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   59     62   
        builder.body(body)?
   60     63   
    })
   61     64   
}
   62     65   
   63     66   
pub(crate) fn de_put_with_content_encoding(
   64     67   
    value: &[u8],
   65     68   
    mut builder: crate::input::put_with_content_encoding_input::Builder,

tmp-codegen-diff/codegen-server-test/json_rpc10/rust-server-codegen/src/protocol_serde/shape_query_incompatible_operation.rs

@@ -1,1 +53,53 @@
    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_incompatible_operation_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::QueryIncompatibleOperationInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::query_incompatible_operation_input::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   
        input.build()
   23     23   
    })
   24     24   
}
   25     25   
   26     26   
#[allow(clippy::unnecessary_wraps)]
   27     27   
pub fn ser_query_incompatible_operation_http_response(
   28     28   
    #[allow(unused_variables)] output: crate::output::QueryIncompatibleOperationOutput,
   29     29   
) -> std::result::Result<
   30     30   
    ::aws_smithy_http_server::response::Response,
   31     31   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   32     32   
> {
   33     33   
    Ok({
   34     34   
        #[allow(unused_mut)]
   35         -
        let mut builder = ::http::Response::builder();
          35  +
        let mut builder = ::http_1x::Response::builder();
   36     36   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   37     37   
            builder,
   38         -
            ::http::header::CONTENT_TYPE,
          38  +
            ::http_1x::header::CONTENT_TYPE,
   39     39   
            "application/x-amz-json-1.0",
   40     40   
        );
   41     41   
        let http_status: u16 = 200;
   42     42   
        builder = builder.status(http_status);
   43     43   
        let payload = "";
   44     44   
        let content_length = payload.len();
   45     45   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   46     46   
            builder,
   47         -
            ::http::header::CONTENT_LENGTH,
          47  +
            ::http_1x::header::CONTENT_LENGTH,
   48     48   
            content_length,
   49     49   
        );
   50     50   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   51     51   
        builder.body(body)?
   52     52   
    })
   53     53   
}

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

@@ -1,1 +91,94 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
#[allow(clippy::unnecessary_wraps)]
    3      3   
pub async fn de_simple_scalar_properties_http_request<B>(
    4         -
    #[allow(unused_variables)] request: ::http::Request<B>,
           4  +
    #[allow(unused_variables)] request: ::http_1x::Request<B>,
    5      5   
) -> std::result::Result<
    6      6   
    crate::input::SimpleScalarPropertiesInput,
    7      7   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8      8   
>
    9      9   
where
   10     10   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     11   
    B::Data: Send,
   12     12   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     13   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     14   
{
   15     15   
    Ok({
   16     16   
        #[allow(unused_mut)]
   17     17   
        let mut input = crate::input::simple_scalar_properties_input::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         -
        let bytes = ::hyper::body::to_bytes(body).await?;
          22  +
        let bytes = {
          23  +
            use ::http_body_util::BodyExt;
          24  +
            body.collect().await?.to_bytes()
          25  +
        };
   23     26   
        if !bytes.is_empty() {
   24     27   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     28   
                &headers,
   26     29   
                Some("application/x-amz-json-1.0"),
   27     30   
            )?;
   28     31   
            input =
   29     32   
                crate::protocol_serde::shape_simple_scalar_properties::de_simple_scalar_properties(
   30     33   
                    bytes.as_ref(),
   31     34   
                    input,
   32     35   
                )?;
   33     36   
        }
   34     37   
        input.build()
   35     38   
    })
   36     39   
}
   37     40   
   38     41   
#[allow(clippy::unnecessary_wraps)]
   39     42   
pub fn ser_simple_scalar_properties_http_response(
   40     43   
    #[allow(unused_variables)] output: crate::output::SimpleScalarPropertiesOutput,
   41     44   
) -> std::result::Result<
   42     45   
    ::aws_smithy_http_server::response::Response,
   43     46   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   44     47   
> {
   45     48   
    Ok({
   46     49   
        #[allow(unused_mut)]
   47         -
        let mut builder = ::http::Response::builder();
          50  +
        let mut builder = ::http_1x::Response::builder();
   48     51   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     52   
            builder,
   50         -
            ::http::header::CONTENT_TYPE,
          53  +
            ::http_1x::header::CONTENT_TYPE,
   51     54   
            "application/x-amz-json-1.0",
   52     55   
        );
   53     56   
        let http_status: u16 = 200;
   54     57   
        builder = builder.status(http_status);
   55     58   
        let payload =
   56     59   
            crate::protocol_serde::shape_simple_scalar_properties_output::ser_simple_scalar_properties_output_output_output(&output)?
   57     60   
        ;
   58     61   
        let content_length = payload.len();
   59     62   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   60     63   
            builder,
   61         -
            ::http::header::CONTENT_LENGTH,
          64  +
            ::http_1x::header::CONTENT_LENGTH,
   62     65   
            content_length,
   63     66   
        );
   64     67   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
   65     68   
        builder.body(body)?
   66     69   
    })
   67     70   
}
   68     71   
   69     72   
pub(crate) fn de_simple_scalar_properties(
   70     73   
    value: &[u8],
   71     74   
    mut builder: crate::input::simple_scalar_properties_input::Builder,