Server Test Python

Server Test Python

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +59,60 @@
   20     20   
pub(crate) mod shape_status_response;
   21     21   
   22     22   
pub(crate) mod shape_string_payload;
   23     23   
   24     24   
pub(crate) mod shape_case_insensitive_error;
   25     25   
   26     26   
pub(crate) mod shape_empty_struct_with_content_on_wire_op_output;
   27     27   
   28     28   
pub(crate) mod shape_enum_query_input;
   29     29   
          30  +
/* JsonParserGenerator.kt:227 */
   30     31   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   31     32   
    if data.is_empty() {
   32     33   
        b"{}"
   33     34   
    } else {
   34     35   
        data
   35     36   
    }
   36     37   
}
   37     38   
   38     39   
pub(crate) mod shape_escaped_string_values_output;
   39     40   

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

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_case_insensitive_error_error(
    3      4   
    value: &crate::error::CaseInsensitiveError,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_case_insensitive_error::ser_case_insensitive_error(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_case_insensitive_error(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::CaseInsensitiveError,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* JsonSerializerGenerator.kt:382 */
   19     26   
    if let Some(var_1) = &input.message {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("message").string(var_1.as_str());
          29  +
        /* JsonSerializerGenerator.kt:382 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

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,200 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_case_insensitive_error_operation_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::CaseInsensitiveErrorOperationInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::case_insensitive_error_operation_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:811 */
   23     31   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   24     33   
        input.build()
          34  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   25     35   
    })
          36  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   26     37   
}
   27     38   
          39  +
/* RustType.kt:516 */
   28     40   
#[allow(clippy::unnecessary_wraps)]
          41  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   29     42   
pub fn ser_case_insensitive_error_operation_http_response(
   30     43   
    #[allow(unused_variables)] output: crate::output::CaseInsensitiveErrorOperationOutput,
   31     44   
) -> std::result::Result<
   32     45   
    ::aws_smithy_http_server::response::Response,
   33     46   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   34     47   
> {
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   35     49   
    Ok({
          50  +
        /* RustType.kt:516 */
   36     51   
        #[allow(unused_mut)]
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   37     53   
        let mut builder = ::http::Response::builder();
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   38     55   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   39     56   
            builder,
   40     57   
            ::http::header::CONTENT_TYPE,
   41     58   
            "application/json",
   42     59   
        );
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   43     61   
        let http_status: u16 = 200;
   44     62   
        builder = builder.status(http_status);
   45         -
        let payload = "";
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          64  +
        let payload =
          65  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   46     68   
        let content_length = payload.len();
   47     69   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     70   
            builder,
   49     71   
            ::http::header::CONTENT_LENGTH,
   50     72   
            content_length,
   51     73   
        );
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   52     75   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   53     77   
        builder.body(body)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   54     79   
    })
          80  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   55     81   
}
   56     82   
          83  +
/* RustType.kt:516 */
   57     84   
#[allow(clippy::unnecessary_wraps)]
          85  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   58     86   
pub fn ser_case_insensitive_error_operation_http_error(
   59     87   
    error: &crate::error::CaseInsensitiveErrorOperationError,
   60     88   
) -> std::result::Result<
   61     89   
    ::aws_smithy_http_server::response::Response,
   62     90   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   63     91   
> {
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   64     93   
    Ok({
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   65     95   
        match error {
          96  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   66     97   
            crate::error::CaseInsensitiveErrorOperationError::CaseInsensitiveError(output) => {
          98  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   67     99   
                let payload = crate::protocol_serde::shape_case_insensitive_error::ser_case_insensitive_error_error(output)?;
         100  +
                /* RustType.kt:516 */
   68    101   
                #[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   69    103   
                let mut builder = ::http::Response::builder();
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   70    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71    106   
                    builder,
   72    107   
                    ::http::header::CONTENT_TYPE,
   73    108   
                    "application/json",
   74    109   
                );
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   75    111   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   76    112   
                    builder,
   77    113   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   78    114   
                    "CaseInsensitiveError",
   79    115   
                );
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   80    117   
                let content_length = payload.len();
   81    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    119   
                    builder,
   83    120   
                    ::http::header::CONTENT_LENGTH,
   84    121   
                    content_length,
   85    122   
                );
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   86    124   
                builder
   87    125   
                    .status(500)
   88    126   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   89    128   
            }
         129  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   90    130   
            crate::error::CaseInsensitiveErrorOperationError::ExtraError(output) => {
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   91    132   
                let payload =
   92    133   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         134  +
                /* RustType.kt:516 */
   93    135   
                #[allow(unused_mut)]
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   94    137   
                let mut builder = ::http::Response::builder();
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   95    139   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96    140   
                    builder,
   97    141   
                    ::http::header::CONTENT_TYPE,
   98    142   
                    "application/json",
   99    143   
                );
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  100    145   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  101    146   
                    builder,
  102    147   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  103    148   
                    "ExtraError",
  104    149   
                );
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  105    151   
                let content_length = payload.len();
  106    152   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    153   
                    builder,
  108    154   
                    ::http::header::CONTENT_LENGTH,
  109    155   
                    content_length,
  110    156   
                );
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  111    158   
                builder
  112    159   
                    .status(500)
  113    160   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  114    162   
            }
         163  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  115    164   
            crate::error::CaseInsensitiveErrorOperationError::InternalServerError(output) => {
         165  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  116    166   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         167  +
                /* RustType.kt:516 */
  117    168   
                #[allow(unused_mut)]
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  118    170   
                let mut builder = ::http::Response::builder();
         171  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  119    172   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  120    173   
                    builder,
  121    174   
                    ::http::header::CONTENT_TYPE,
  122    175   
                    "application/json",
  123    176   
                );
         177  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  124    178   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  125    179   
                    builder,
  126    180   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  127    181   
                    "InternalServerError",
  128    182   
                );
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  129    184   
                let content_length = payload.len();
  130    185   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  131    186   
                    builder,
  132    187   
                    ::http::header::CONTENT_LENGTH,
  133    188   
                    content_length,
  134    189   
                );
         190  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  135    191   
                builder
  136    192   
                    .status(500)
  137    193   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         194  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         195  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  138    196   
        }
  139         -
        }
         197  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  140    198   
    })
         199  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  141    200   
}

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

@@ -1,1 +7,10 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:358 */
    2      3   
pub fn ser_empty_struct(
    3      4   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4      5   
    #[allow(unused_variables)] input: &crate::model::EmptyStruct,
    5      6   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
           7  +
    /* JsonSerializerGenerator.kt:372 */
    6      8   
    Ok(())
           9  +
    /* JsonSerializerGenerator.kt:358 */
    7     10   
}

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,167 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_empty_struct_with_content_on_wire_op_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EmptyStructWithContentOnWireOpInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input =
   18     23   
            crate::input::empty_struct_with_content_on_wire_op_input_internal::Builder::default();
          24  +
        /* RustType.kt:516 */
   19     25   
        #[allow(unused_variables)]
          26  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   20     27   
        let ::aws_smithy_runtime_api::http::RequestParts {
   21     28   
            uri, headers, body, ..
   22     29   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          30  +
        /* ServerHttpBoundProtocolGenerator.kt:811 */
   23     31   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          32  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   24     33   
        input.build()
          34  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   25     35   
    })
          36  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   26     37   
}
   27     38   
          39  +
/* RustType.kt:516 */
   28     40   
#[allow(clippy::unnecessary_wraps)]
          41  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   29     42   
pub fn ser_empty_struct_with_content_on_wire_op_http_response(
   30     43   
    #[allow(unused_variables)] output: crate::output::EmptyStructWithContentOnWireOpOutput,
   31     44   
) -> std::result::Result<
   32     45   
    ::aws_smithy_http_server::response::Response,
   33     46   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   34     47   
> {
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   35     49   
    Ok({
          50  +
        /* RustType.kt:516 */
   36     51   
        #[allow(unused_mut)]
          52  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   37     53   
        let mut builder = ::http::Response::builder();
          54  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   38     55   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   39     56   
            builder,
   40     57   
            ::http::header::CONTENT_TYPE,
   41     58   
            "application/json",
   42     59   
        );
          60  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   43     61   
        let http_status: u16 = 200;
   44     62   
        builder = builder.status(http_status);
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   45     64   
        let payload =
   46         -
            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         -
        ;
          65  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_empty_struct_with_content_on_wire_op_output::ser_empty_struct_with_content_on_wire_op_output_output_output(&output)?
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          67  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   48     68   
        let content_length = payload.len();
   49     69   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   50     70   
            builder,
   51     71   
            ::http::header::CONTENT_LENGTH,
   52     72   
            content_length,
   53     73   
        );
          74  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   54     75   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   55     77   
        builder.body(body)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   56     79   
    })
          80  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   57     81   
}
   58     82   
          83  +
/* RustType.kt:516 */
   59     84   
#[allow(clippy::unnecessary_wraps)]
          85  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   60     86   
pub fn ser_empty_struct_with_content_on_wire_op_http_error(
   61     87   
    error: &crate::error::EmptyStructWithContentOnWireOpError,
   62     88   
) -> std::result::Result<
   63     89   
    ::aws_smithy_http_server::response::Response,
   64     90   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   65     91   
> {
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   66     93   
    Ok({
          94  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   67     95   
        match error {
          96  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   68     97   
            crate::error::EmptyStructWithContentOnWireOpError::ExtraError(output) => {
          98  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   69     99   
                let payload =
   70    100   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         101  +
                /* RustType.kt:516 */
   71    102   
                #[allow(unused_mut)]
         103  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   72    104   
                let mut builder = ::http::Response::builder();
         105  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   73    106   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   74    107   
                    builder,
   75    108   
                    ::http::header::CONTENT_TYPE,
   76    109   
                    "application/json",
   77    110   
                );
         111  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   78    112   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79    113   
                    builder,
   80    114   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   81    115   
                    "ExtraError",
   82    116   
                );
         117  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   83    118   
                let content_length = payload.len();
   84    119   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   85    120   
                    builder,
   86    121   
                    ::http::header::CONTENT_LENGTH,
   87    122   
                    content_length,
   88    123   
                );
         124  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   89    125   
                builder
   90    126   
                    .status(500)
   91    127   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   92    129   
            }
         130  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   93    131   
            crate::error::EmptyStructWithContentOnWireOpError::InternalServerError(output) => {
         132  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   94    133   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         134  +
                /* RustType.kt:516 */
   95    135   
                #[allow(unused_mut)]
         136  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   96    137   
                let mut builder = ::http::Response::builder();
         138  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   97    139   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   98    140   
                    builder,
   99    141   
                    ::http::header::CONTENT_TYPE,
  100    142   
                    "application/json",
  101    143   
                );
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  102    145   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    146   
                    builder,
  104    147   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  105    148   
                    "InternalServerError",
  106    149   
                );
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  107    151   
                let content_length = payload.len();
  108    152   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  109    153   
                    builder,
  110    154   
                    ::http::header::CONTENT_LENGTH,
  111    155   
                    content_length,
  112    156   
                );
         157  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  113    158   
                builder
  114    159   
                    .status(500)
  115    160   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         162  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  116    163   
        }
  117         -
        }
         164  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  118    165   
    })
         166  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  119    167   
}

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

@@ -1,1 +23,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_empty_struct_with_content_on_wire_op_output_output_output(
    3      4   
    value: &crate::output::EmptyStructWithContentOnWireOpOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_empty_struct_with_content_on_wire_op_output::ser_empty_struct_with_content_on_wire_op_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_empty_struct_with_content_on_wire_op_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::EmptyStructWithContentOnWireOpOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.empty {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("empty").start_object();
          28  +
        /* JsonSerializerGenerator.kt:375 */
   19     29   
        crate::protocol_serde::shape_empty_struct::ser_empty_struct(&mut object_2, var_1)?;
          30  +
        /* JsonSerializerGenerator.kt:515 */
   20     31   
        object_2.finish();
          32  +
        /* JsonSerializerGenerator.kt:382 */
   21     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:372 */
   22     35   
    Ok(())
          36  +
    /* JsonSerializerGenerator.kt:358 */
   23     37   
}

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

@@ -1,1 +156,217 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_enum_query_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EnumQueryInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::enum_query_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:986 */
   22     30   
        let input_string = uri.path();
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:998 */
   23     32   
        let (input_string, (_, m1)) =
   24     33   
            ::nom::sequence::tuple::<_, _, ::nom::error::Error<&str>, _>((
   25     34   
                ::nom::sequence::preceded(
   26     35   
                    ::nom::bytes::complete::tag("/"),
   27     36   
                    ::nom::bytes::complete::tag::<_, _, ::nom::error::Error<&str>>("foo"),
   28     37   
                ),
   29     38   
                ::nom::sequence::preceded(
   30     39   
                    ::nom::bytes::complete::tag("/"),
   31     40   
                    ::nom::branch::alt::<_, _, ::nom::error::Error<&str>, _>((
   32     41   
                        ::nom::bytes::complete::take_until("/"),
   33     42   
                        ::nom::combinator::rest,
   34     43   
                    )),
   35     44   
                ),
   36     45   
            ))(input_string)?;
   37     46   
        debug_assert_eq!("", input_string);
          47  +
        /* ServerHttpBoundProtocolGenerator.kt:1009 */
   38     48   
        input = input.set_enum(crate::protocol_serde::shape_enum_query_input::de_enum(m1)?);
          49  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   39     50   
        input.build()?
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   40     52   
    })
          53  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   41     54   
}
   42     55   
          56  +
/* RustType.kt:516 */
   43     57   
#[allow(clippy::unnecessary_wraps)]
          58  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   44     59   
pub fn ser_enum_query_http_response(
   45     60   
    #[allow(unused_variables)] output: crate::output::EnumQueryOutput,
   46     61   
) -> std::result::Result<
   47     62   
    ::aws_smithy_http_server::response::Response,
   48     63   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   49     64   
> {
          65  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   50     66   
    Ok({
          67  +
        /* RustType.kt:516 */
   51     68   
        #[allow(unused_mut)]
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   52     70   
        let mut builder = ::http::Response::builder();
          71  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   53     72   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   54     73   
            builder,
   55     74   
            ::http::header::CONTENT_TYPE,
   56     75   
            "application/json",
   57     76   
        );
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   58     78   
        let http_status: u16 = 200;
   59     79   
        builder = builder.status(http_status);
   60         -
        let payload = "";
          80  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
          81  +
        let payload =
          82  +
            /* HttpBoundProtocolPayloadGenerator.kt:235 */""
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          84  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   61     85   
        let content_length = payload.len();
   62     86   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   63     87   
            builder,
   64     88   
            ::http::header::CONTENT_LENGTH,
   65     89   
            content_length,
   66     90   
        );
          91  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   67     92   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   68     94   
        builder.body(body)?
          95  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   69     96   
    })
          97  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   70     98   
}
   71     99   
         100  +
/* RustType.kt:516 */
   72    101   
#[allow(clippy::unnecessary_wraps)]
         102  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   73    103   
pub fn ser_enum_query_http_error(
   74    104   
    error: &crate::error::EnumQueryError,
   75    105   
) -> std::result::Result<
   76    106   
    ::aws_smithy_http_server::response::Response,
   77    107   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   78    108   
> {
         109  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   79    110   
    Ok({
         111  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   80    112   
        match error {
         113  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   81    114   
            crate::error::EnumQueryError::ValidationException(output) => {
         115  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   82    116   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         117  +
                /* RustType.kt:516 */
   83    118   
                #[allow(unused_mut)]
         119  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   84    120   
                let mut builder = ::http::Response::builder();
         121  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   85    122   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   86    123   
                    builder,
   87    124   
                    ::http::header::CONTENT_TYPE,
   88    125   
                    "application/json",
   89    126   
                );
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   90    128   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   91    129   
                    builder,
   92    130   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   93    131   
                    "ValidationException",
   94    132   
                );
         133  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   95    134   
                let content_length = payload.len();
   96    135   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    136   
                    builder,
   98    137   
                    ::http::header::CONTENT_LENGTH,
   99    138   
                    content_length,
  100    139   
                );
         140  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  101    141   
                builder
  102    142   
                    .status(400)
  103    143   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         144  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  104    145   
            }
         146  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  105    147   
            crate::error::EnumQueryError::ExtraError(output) => {
         148  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  106    149   
                let payload =
  107    150   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         151  +
                /* RustType.kt:516 */
  108    152   
                #[allow(unused_mut)]
         153  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  109    154   
                let mut builder = ::http::Response::builder();
         155  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  110    156   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  111    157   
                    builder,
  112    158   
                    ::http::header::CONTENT_TYPE,
  113    159   
                    "application/json",
  114    160   
                );
         161  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  115    162   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  116    163   
                    builder,
  117    164   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  118    165   
                    "ExtraError",
  119    166   
                );
         167  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  120    168   
                let content_length = payload.len();
  121    169   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  122    170   
                    builder,
  123    171   
                    ::http::header::CONTENT_LENGTH,
  124    172   
                    content_length,
  125    173   
                );
         174  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  126    175   
                builder
  127    176   
                    .status(500)
  128    177   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         178  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  129    179   
            }
         180  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  130    181   
            crate::error::EnumQueryError::InternalServerError(output) => {
         182  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  131    183   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         184  +
                /* RustType.kt:516 */
  132    185   
                #[allow(unused_mut)]
         186  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  133    187   
                let mut builder = ::http::Response::builder();
         188  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  134    189   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  135    190   
                    builder,
  136    191   
                    ::http::header::CONTENT_TYPE,
  137    192   
                    "application/json",
  138    193   
                );
         194  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  139    195   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  140    196   
                    builder,
  141    197   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  142    198   
                    "InternalServerError",
  143    199   
                );
         200  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  144    201   
                let content_length = payload.len();
  145    202   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  146    203   
                    builder,
  147    204   
                    ::http::header::CONTENT_LENGTH,
  148    205   
                    content_length,
  149    206   
                );
         207  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  150    208   
                builder
  151    209   
                    .status(500)
  152    210   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         211  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         212  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  153    213   
        }
  154         -
        }
         214  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  155    215   
    })
         216  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  156    217   
}

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,16 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:1292 */
    2      3   
pub fn de_enum(
    3      4   
    value: &str,
    4      5   
) -> std::result::Result<
    5      6   
    ::std::string::String,
    6      7   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    7      8   
> {
           9  +
    /* ServerHttpBoundProtocolGenerator.kt:1302 */
    8     10   
    let value = ::percent_encoding::percent_decode_str(value)
    9     11   
        .decode_utf8()?
   10     12   
        .into_owned();
          13  +
    /* ServerHttpBoundProtocolGenerator.kt:1357 */
   11     14   
    Ok(value)
          15  +
    /* ServerHttpBoundProtocolGenerator.kt:1292 */
   12     16   
}

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

@@ -1,1 +210,299 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_escaped_string_values_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::EscapedStringValuesInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::escaped_string_values_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/json"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()?
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_escaped_string_values_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::EscapedStringValuesOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/json",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   54     76   
        let payload =
   55         -
            crate::protocol_serde::shape_escaped_string_values_output::ser_escaped_string_values_output_output_output(&output)?
   56         -
        ;
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_escaped_string_values_output::ser_escaped_string_values_output_output_output(&output)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   57     80   
        let content_length = payload.len();
   58     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     82   
            builder,
   60     83   
            ::http::header::CONTENT_LENGTH,
   61     84   
            content_length,
   62     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   63     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   64     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   65     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   66     93   
}
   67     94   
          95  +
/* RustType.kt:516 */
   68     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   69     98   
pub fn ser_escaped_string_values_http_error(
   70     99   
    error: &crate::error::EscapedStringValuesError,
   71    100   
) -> std::result::Result<
   72    101   
    ::aws_smithy_http_server::response::Response,
   73    102   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   75    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   76    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   77    109   
            crate::error::EscapedStringValuesError::ValidationException(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   78    111   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         112  +
                /* RustType.kt:516 */
   79    113   
                #[allow(unused_mut)]
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   80    115   
                let mut builder = ::http::Response::builder();
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   81    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    118   
                    builder,
   83    119   
                    ::http::header::CONTENT_TYPE,
   84    120   
                    "application/json",
   85    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   86    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87    124   
                    builder,
   88    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89    126   
                    "ValidationException",
   90    127   
                );
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   91    129   
                let content_length = payload.len();
   92    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93    131   
                    builder,
   94    132   
                    ::http::header::CONTENT_LENGTH,
   95    133   
                    content_length,
   96    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   97    136   
                builder
   98    137   
                    .status(400)
   99    138   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  100    140   
            }
         141  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  101    142   
            crate::error::EscapedStringValuesError::ExtraError(output) => {
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  102    144   
                let payload =
  103    145   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         146  +
                /* RustType.kt:516 */
  104    147   
                #[allow(unused_mut)]
         148  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  105    149   
                let mut builder = ::http::Response::builder();
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  106    151   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    152   
                    builder,
  108    153   
                    ::http::header::CONTENT_TYPE,
  109    154   
                    "application/json",
  110    155   
                );
         156  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  111    157   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    158   
                    builder,
  113    159   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    160   
                    "ExtraError",
  115    161   
                );
         162  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  116    163   
                let content_length = payload.len();
  117    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    165   
                    builder,
  119    166   
                    ::http::header::CONTENT_LENGTH,
  120    167   
                    content_length,
  121    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  122    170   
                builder
  123    171   
                    .status(500)
  124    172   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  125    174   
            }
         175  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  126    176   
            crate::error::EscapedStringValuesError::InternalServerError(output) => {
         177  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  127    178   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         179  +
                /* RustType.kt:516 */
  128    180   
                #[allow(unused_mut)]
         181  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  129    182   
                let mut builder = ::http::Response::builder();
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  130    184   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  131    185   
                    builder,
  132    186   
                    ::http::header::CONTENT_TYPE,
  133    187   
                    "application/json",
  134    188   
                );
         189  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  135    190   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  136    191   
                    builder,
  137    192   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  138    193   
                    "InternalServerError",
  139    194   
                );
         195  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  140    196   
                let content_length = payload.len();
  141    197   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    198   
                    builder,
  143    199   
                    ::http::header::CONTENT_LENGTH,
  144    200   
                    content_length,
  145    201   
                );
         202  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  146    203   
                builder
  147    204   
                    .status(500)
  148    205   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         206  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         207  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  149    208   
        }
  150         -
        }
         209  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  151    210   
    })
         211  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  152    212   
}
  153    213   
         214  +
/* JsonParserGenerator.kt:148 */
  154    215   
pub(crate) fn de_escaped_string_values(
  155    216   
    value: &[u8],
  156    217   
    mut builder: crate::input::escaped_string_values_input_internal::Builder,
  157    218   
) -> ::std::result::Result<
  158    219   
    crate::input::escaped_string_values_input_internal::Builder,
  159    220   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  160    221   
> {
         222  +
    /* JsonParserGenerator.kt:153 */
  161    223   
    let mut tokens_owned =
  162    224   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  163    225   
            .peekable();
  164    226   
    let tokens = &mut tokens_owned;
  165    227   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         228  +
    /* JsonParserGenerator.kt:684 */
  166    229   
    loop {
         230  +
        /* JsonParserGenerator.kt:685 */
  167    231   
        match tokens.next().transpose()? {
         232  +
            /* JsonParserGenerator.kt:686 */
  168    233   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  169    234   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         235  +
                /* JsonParserGenerator.kt:260 */
  170    236   
                match key.to_unescaped()?.as_ref() {
         237  +
                    /* JsonParserGenerator.kt:262 */
  171    238   
                    "enum" => {
         239  +
                        /* JsonParserGenerator.kt:272 */
  172    240   
                        builder = builder.set_enum(
         241  +
                            /* JsonParserGenerator.kt:354 */
  173    242   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  174    243   
                                tokens.next(),
  175    244   
                            )?
  176         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  177         -
                            .transpose()?,
         245  +
                            .map(|s|
         246  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         247  +
                                    /* JsonParserGenerator.kt:343 */u.into_owned()
         248  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         249  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  178    250   
                        );
         251  +
                        /* JsonParserGenerator.kt:262 */
  179    252   
                    }
         253  +
                    /* JsonParserGenerator.kt:262 */
  180    254   
                    "also\"has\"quotes" => {
         255  +
                        /* JsonParserGenerator.kt:272 */
  181    256   
                        builder = builder.set_some_string(
         257  +
                            /* JsonParserGenerator.kt:354 */
  182    258   
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
  183    259   
                                tokens.next(),
  184    260   
                            )?
  185         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  186         -
                            .transpose()?,
         261  +
                            .map(|s|
         262  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
         263  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
         264  +
                                /* JsonParserGenerator.kt:339 */) /* JsonParserGenerator.kt:354 */)
         265  +
                            .transpose()?, /* JsonParserGenerator.kt:272 */
  187    266   
                        );
         267  +
                        /* JsonParserGenerator.kt:262 */
  188    268   
                    }
  189         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         269  +
                    /* JsonParserGenerator.kt:290 */
         270  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  190    271   
                }
         272  +
                /* JsonParserGenerator.kt:686 */
  191    273   
            }
         274  +
            /* JsonParserGenerator.kt:695 */
  192    275   
            other => {
  193    276   
                return Err(
  194    277   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  195    278   
                        "expected object key or end object, found: {:?}",
  196    279   
                        other
  197    280   
                    )),
  198    281   
                )
         282  +
            } /* JsonParserGenerator.kt:685 */
  199    283   
        }
         284  +
        /* JsonParserGenerator.kt:684 */
  200    285   
    }
  201         -
    }
         286  +
    /* JsonParserGenerator.kt:250 */
  202    287   
    if tokens.next().is_some() {
         288  +
        /* JsonParserGenerator.kt:251 */
  203    289   
        return Err(
  204    290   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  205    291   
                "found more JSON tokens after completing parsing",
  206    292   
            ),
  207    293   
        );
         294  +
        /* JsonParserGenerator.kt:250 */
  208    295   
    }
         296  +
    /* JsonParserGenerator.kt:163 */
  209    297   
    Ok(builder)
         298  +
    /* JsonParserGenerator.kt:148 */
  210    299   
}

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

@@ -1,1 +23,37 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_escaped_string_values_output_output_output(
    3      4   
    value: &crate::output::EscapedStringValuesOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_escaped_string_values_output::ser_escaped_string_values_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_escaped_string_values_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::EscapedStringValuesOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.r#enum {
          24  +
        /* JsonSerializerGenerator.kt:423 */
   17     25   
        object.key("enum").string(var_1.as_str());
          26  +
        /* JsonSerializerGenerator.kt:382 */
   18     27   
    }
          28  +
    /* JsonSerializerGenerator.kt:382 */
   19     29   
    if let Some(var_2) = &input.some_string {
          30  +
        /* JsonSerializerGenerator.kt:423 */
   20     31   
        object.key("also\"has\"quotes").string(var_2.as_str());
          32  +
        /* JsonSerializerGenerator.kt:382 */
   21     33   
    }
          34  +
    /* JsonSerializerGenerator.kt:372 */
   22     35   
    Ok(())
          36  +
    /* JsonSerializerGenerator.kt:358 */
   23     37   
}

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

@@ -1,1 +17,25 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_extra_error_error(
    3      4   
    value: &crate::error::ExtraError,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_extra_error::ser_extra_error(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_extra_error(
   13     19   
    #[allow(unused_variables)] object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    #[allow(unused_variables)] input: &crate::error::ExtraError,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:372 */
   16     23   
    Ok(())
          24  +
    /* JsonSerializerGenerator.kt:358 */
   17     25   
}

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

@@ -1,1 +23,34 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_internal_server_error_error(
    3      4   
    value: &crate::error::InternalServerError,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_internal_server_error::ser_internal_server_error(
    8     11   
        &mut object,
    9     12   
        value,
   10     13   
    )?;
          14  +
    /* JsonSerializerGenerator.kt:227 */
   11     15   
    object.finish();
   12     16   
    Ok(out)
          17  +
    /* JsonSerializerGenerator.kt:213 */
   13     18   
}
   14     19   
          20  +
/* JsonSerializerGenerator.kt:358 */
   15     21   
pub fn ser_internal_server_error(
   16     22   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   17     23   
    input: &crate::error::InternalServerError,
   18     24   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          25  +
    /* SerializerUtil.kt:42 */
   19     26   
    {
          27  +
        /* JsonSerializerGenerator.kt:423 */
   20     28   
        object.key("message").string(input.message.as_str());
          29  +
        /* SerializerUtil.kt:42 */
   21     30   
    }
          31  +
    /* JsonSerializerGenerator.kt:372 */
   22     32   
    Ok(())
          33  +
    /* JsonSerializerGenerator.kt:358 */
   23     34   
}

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

@@ -1,1 +64,91 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:460 */
    2      3   
pub(crate) fn de_map_with_enum_key<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::map_with_enum_key_unconstrained::MapWithEnumKeyUnconstrained>,
    6      7   
    ::aws_smithy_json::deserialize::error::DeserializeError,
    7      8   
>
    8      9   
where
    9     10   
    I: Iterator<
   10     11   
        Item = Result<
   11     12   
            ::aws_smithy_json::deserialize::Token<'a>,
   12     13   
            ::aws_smithy_json::deserialize::error::DeserializeError,
   13     14   
        >,
   14     15   
    >,
   15     16   
{
          17  +
    /* JsonParserGenerator.kt:712 */
   16     18   
    match tokens.next().transpose()? {
          19  +
        /* JsonParserGenerator.kt:713 */
   17     20   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   18     21   
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          22  +
            /* JsonParserGenerator.kt:469 */
   19     23   
            let mut map = ::std::collections::HashMap::new();
          24  +
            /* JsonParserGenerator.kt:684 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   21     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   22     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   23     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
   24         -
                        let key = key.to_unescaped().map(|u| u.into_owned())?;
   25         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   26         -
                            tokens.next(),
   27         -
                        )?
   28         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   29         -
                        .transpose()?;
          31  +
                        /* JsonParserGenerator.kt:471 */
          32  +
                        let key =
          33  +
                            /* JsonParserGenerator.kt:339 */key.to_unescaped().map(|u|
          34  +
                                /* JsonParserGenerator.kt:343 */u.into_owned()
          35  +
                            /* JsonParserGenerator.kt:339 */)
          36  +
                        /* JsonParserGenerator.kt:471 */?;
          37  +
                        /* JsonParserGenerator.kt:474 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          40  +
                                /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          41  +
                                    /* JsonParserGenerator.kt:348 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:474 */;
          45  +
                        /* JsonParserGenerator.kt:481 */
   30     46   
                        match value {
   31     47   
                            Some(value) => {
   32     48   
                                map.insert(key, value);
   33     49   
                            }
   34     50   
                            None => {
   35     51   
                                return Err(
   36     52   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                        "dense map cannot contain null values",
   38     54   
                                    ),
   39     55   
                                )
   40     56   
                            }
   41     57   
                        }
          58  +
                        /* JsonParserGenerator.kt:686 */
   42     59   
                    }
          60  +
                    /* JsonParserGenerator.kt:695 */
   43     61   
                    other => {
   44     62   
                        return Err(
   45     63   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   46     64   
                                format!("expected object key or end object, found: {:?}", other),
   47     65   
                            ),
   48     66   
                        )
          67  +
                    } /* JsonParserGenerator.kt:685 */
   49     68   
                }
          69  +
                /* JsonParserGenerator.kt:684 */
   50     70   
            }
   51         -
            }
          71  +
            /* JsonParserGenerator.kt:502 */
   52     72   
            Ok(Some(
   53     73   
                crate::unconstrained::map_with_enum_key_unconstrained::MapWithEnumKeyUnconstrained(
   54     74   
                    map,
   55     75   
                ),
   56     76   
            ))
          77  +
            /* JsonParserGenerator.kt:713 */
   57     78   
        }
   58         -
        _ => Err(
          79  +
        /* JsonParserGenerator.kt:722 */
          80  +
        _ => {
          81  +
            /* JsonParserGenerator.kt:723 */
          82  +
            Err(
   59     83   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   60     84   
                    "expected start object or null",
   61     85   
                ),
   62         -
        ),
          86  +
            )
          87  +
            /* JsonParserGenerator.kt:722 */
          88  +
        } /* JsonParserGenerator.kt:712 */
   63     89   
    }
          90  +
    /* JsonParserGenerator.kt:460 */
   64     91   
}

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 +199,278 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_map_with_enum_key_op_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::MapWithEnumKeyOpInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::map_with_enum_key_op_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/json"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op(
   29     39   
                bytes.as_ref(),
   30     40   
                input,
   31     41   
            )?;
          42  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   32     43   
        }
          44  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   33     45   
        input.build()?
          46  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   34     47   
    })
          48  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   35     49   
}
   36     50   
          51  +
/* RustType.kt:516 */
   37     52   
#[allow(clippy::unnecessary_wraps)]
          53  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   38     54   
pub fn ser_map_with_enum_key_op_http_response(
   39     55   
    #[allow(unused_variables)] output: crate::output::MapWithEnumKeyOpOutput,
   40     56   
) -> std::result::Result<
   41     57   
    ::aws_smithy_http_server::response::Response,
   42     58   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   43     59   
> {
          60  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   44     61   
    Ok({
          62  +
        /* RustType.kt:516 */
   45     63   
        #[allow(unused_mut)]
          64  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   46     65   
        let mut builder = ::http::Response::builder();
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   47     67   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   48     68   
            builder,
   49     69   
            ::http::header::CONTENT_TYPE,
   50     70   
            "application/json",
   51     71   
        );
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   52     73   
        let http_status: u16 = 200;
   53     74   
        builder = builder.status(http_status);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   54     76   
        let payload =
   55         -
            crate::protocol_serde::shape_map_with_enum_key_op_output::ser_map_with_enum_key_op_output_output_output(&output)?
   56         -
        ;
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_map_with_enum_key_op_output::ser_map_with_enum_key_op_output_output_output(&output)?
          78  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          79  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   57     80   
        let content_length = payload.len();
   58     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   59     82   
            builder,
   60     83   
            ::http::header::CONTENT_LENGTH,
   61     84   
            content_length,
   62     85   
        );
          86  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   63     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          88  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   64     89   
        builder.body(body)?
          90  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   65     91   
    })
          92  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   66     93   
}
   67     94   
          95  +
/* RustType.kt:516 */
   68     96   
#[allow(clippy::unnecessary_wraps)]
          97  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   69     98   
pub fn ser_map_with_enum_key_op_http_error(
   70     99   
    error: &crate::error::MapWithEnumKeyOpError,
   71    100   
) -> std::result::Result<
   72    101   
    ::aws_smithy_http_server::response::Response,
   73    102   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   74    103   
> {
         104  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   75    105   
    Ok({
         106  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   76    107   
        match error {
         108  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   77    109   
            crate::error::MapWithEnumKeyOpError::ValidationException(output) => {
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   78    111   
                let payload = crate::protocol_serde::shape_validation_exception::ser_validation_exception_error(output)?;
         112  +
                /* RustType.kt:516 */
   79    113   
                #[allow(unused_mut)]
         114  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   80    115   
                let mut builder = ::http::Response::builder();
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   81    117   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82    118   
                    builder,
   83    119   
                    ::http::header::CONTENT_TYPE,
   84    120   
                    "application/json",
   85    121   
                );
         122  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   86    123   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   87    124   
                    builder,
   88    125   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   89    126   
                    "ValidationException",
   90    127   
                );
         128  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   91    129   
                let content_length = payload.len();
   92    130   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93    131   
                    builder,
   94    132   
                    ::http::header::CONTENT_LENGTH,
   95    133   
                    content_length,
   96    134   
                );
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   97    136   
                builder
   98    137   
                    .status(400)
   99    138   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         139  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  100    140   
            }
         141  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  101    142   
            crate::error::MapWithEnumKeyOpError::ExtraError(output) => {
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  102    144   
                let payload =
  103    145   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         146  +
                /* RustType.kt:516 */
  104    147   
                #[allow(unused_mut)]
         148  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  105    149   
                let mut builder = ::http::Response::builder();
         150  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  106    151   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  107    152   
                    builder,
  108    153   
                    ::http::header::CONTENT_TYPE,
  109    154   
                    "application/json",
  110    155   
                );
         156  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  111    157   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  112    158   
                    builder,
  113    159   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  114    160   
                    "ExtraError",
  115    161   
                );
         162  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  116    163   
                let content_length = payload.len();
  117    164   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  118    165   
                    builder,
  119    166   
                    ::http::header::CONTENT_LENGTH,
  120    167   
                    content_length,
  121    168   
                );
         169  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  122    170   
                builder
  123    171   
                    .status(500)
  124    172   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         173  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
  125    174   
            }
         175  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
  126    176   
            crate::error::MapWithEnumKeyOpError::InternalServerError(output) => {
         177  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
  127    178   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         179  +
                /* RustType.kt:516 */
  128    180   
                #[allow(unused_mut)]
         181  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
  129    182   
                let mut builder = ::http::Response::builder();
         183  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  130    184   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  131    185   
                    builder,
  132    186   
                    ::http::header::CONTENT_TYPE,
  133    187   
                    "application/json",
  134    188   
                );
         189  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  135    190   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  136    191   
                    builder,
  137    192   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  138    193   
                    "InternalServerError",
  139    194   
                );
         195  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  140    196   
                let content_length = payload.len();
  141    197   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  142    198   
                    builder,
  143    199   
                    ::http::header::CONTENT_LENGTH,
  144    200   
                    content_length,
  145    201   
                );
         202  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  146    203   
                builder
  147    204   
                    .status(500)
  148    205   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         206  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         207  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  149    208   
        }
  150         -
        }
         209  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  151    210   
    })
         211  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  152    212   
}
  153    213   
         214  +
/* JsonParserGenerator.kt:148 */
  154    215   
pub(crate) fn de_map_with_enum_key_op(
  155    216   
    value: &[u8],
  156    217   
    mut builder: crate::input::map_with_enum_key_op_input_internal::Builder,
  157    218   
) -> ::std::result::Result<
  158    219   
    crate::input::map_with_enum_key_op_input_internal::Builder,
  159    220   
    ::aws_smithy_json::deserialize::error::DeserializeError,
  160    221   
> {
         222  +
    /* JsonParserGenerator.kt:153 */
  161    223   
    let mut tokens_owned =
  162    224   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
  163    225   
            .peekable();
  164    226   
    let tokens = &mut tokens_owned;
  165    227   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         228  +
    /* JsonParserGenerator.kt:684 */
  166    229   
    loop {
         230  +
        /* JsonParserGenerator.kt:685 */
  167    231   
        match tokens.next().transpose()? {
         232  +
            /* JsonParserGenerator.kt:686 */
  168    233   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  169    234   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         235  +
                /* JsonParserGenerator.kt:260 */
  170    236   
                match key.to_unescaped()?.as_ref() {
         237  +
                    /* JsonParserGenerator.kt:262 */
  171    238   
                    "map" => {
         239  +
                        /* JsonParserGenerator.kt:272 */
  172    240   
                        builder = builder.set_map(
         241  +
                            /* JsonParserGenerator.kt:509 */
  173    242   
                            crate::protocol_serde::shape_map_with_enum_key::de_map_with_enum_key(
  174    243   
                                tokens,
  175         -
                            )?,
         244  +
                            )?, /* JsonParserGenerator.kt:272 */
  176    245   
                        );
         246  +
                        /* JsonParserGenerator.kt:262 */
  177    247   
                    }
  178         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         248  +
                    /* JsonParserGenerator.kt:290 */
         249  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
  179    250   
                }
         251  +
                /* JsonParserGenerator.kt:686 */
  180    252   
            }
         253  +
            /* JsonParserGenerator.kt:695 */
  181    254   
            other => {
  182    255   
                return Err(
  183    256   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  184    257   
                        "expected object key or end object, found: {:?}",
  185    258   
                        other
  186    259   
                    )),
  187    260   
                )
         261  +
            } /* JsonParserGenerator.kt:685 */
  188    262   
        }
         263  +
        /* JsonParserGenerator.kt:684 */
  189    264   
    }
  190         -
    }
         265  +
    /* JsonParserGenerator.kt:250 */
  191    266   
    if tokens.next().is_some() {
         267  +
        /* JsonParserGenerator.kt:251 */
  192    268   
        return Err(
  193    269   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  194    270   
                "found more JSON tokens after completing parsing",
  195    271   
            ),
  196    272   
        );
         273  +
        /* JsonParserGenerator.kt:250 */
  197    274   
    }
         275  +
    /* JsonParserGenerator.kt:163 */
  198    276   
    Ok(builder)
         277  +
    /* JsonParserGenerator.kt:148 */
  199    278   
}

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

@@ -1,1 +27,45 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonSerializerGenerator.kt:213 */
    2      3   
pub fn ser_map_with_enum_key_op_output_output_output(
    3      4   
    value: &crate::output::MapWithEnumKeyOpOutput,
    4      5   
) -> ::std::result::Result<String, ::aws_smithy_types::error::operation::SerializationError> {
           6  +
    /* JsonSerializerGenerator.kt:218 */
    5      7   
    let mut out = ::std::string::String::new();
    6      8   
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
           9  +
    /* JsonSerializerGenerator.kt:375 */
    7     10   
    crate::protocol_serde::shape_map_with_enum_key_op_output::ser_map_with_enum_key_op_output_output(&mut object, value)?;
          11  +
    /* JsonSerializerGenerator.kt:227 */
    8     12   
    object.finish();
    9     13   
    Ok(out)
          14  +
    /* JsonSerializerGenerator.kt:213 */
   10     15   
}
   11     16   
          17  +
/* JsonSerializerGenerator.kt:358 */
   12     18   
pub fn ser_map_with_enum_key_op_output_output(
   13     19   
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
   14     20   
    input: &crate::output::MapWithEnumKeyOpOutput,
   15     21   
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
          22  +
    /* JsonSerializerGenerator.kt:382 */
   16     23   
    if let Some(var_1) = &input.map {
          24  +
        /* JsonSerializerGenerator.kt:495 */
   17     25   
        #[allow(unused_mut)]
          26  +
        /* JsonSerializerGenerator.kt:496 */
   18     27   
        let mut object_2 = object.key("map").start_object();
          28  +
        /* JsonSerializerGenerator.kt:537 */
   19     29   
        for (key_3, value_4) in var_1 {
          30  +
            /* SerializerUtil.kt:42 */
   20     31   
            {
          32  +
                /* JsonSerializerGenerator.kt:423 */
   21     33   
                object_2.key(key_3.as_str()).string(value_4.as_str());
          34  +
                /* SerializerUtil.kt:42 */
   22     35   
            }
          36  +
            /* JsonSerializerGenerator.kt:537 */
   23     37   
        }
          38  +
        /* JsonSerializerGenerator.kt:515 */
   24     39   
        object_2.finish();
          40  +
        /* JsonSerializerGenerator.kt:382 */
   25     41   
    }
          42  +
    /* JsonSerializerGenerator.kt:372 */
   26     43   
    Ok(())
          44  +
    /* JsonSerializerGenerator.kt:358 */
   27     45   
}

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,166 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_null_in_non_sparse_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::NullInNonSparseInput,
    7      9   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::null_in_non_sparse_input_internal::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:811 */
   22     30   
        ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(&headers, None)?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   23     32   
        input.build()
          33  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   24     34   
    })
          35  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   25     36   
}
   26     37   
          38  +
/* RustType.kt:516 */
   27     39   
#[allow(clippy::unnecessary_wraps)]
          40  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   28     41   
pub fn ser_null_in_non_sparse_http_response(
   29     42   
    #[allow(unused_variables)] output: crate::output::NullInNonSparseOutput,
   30     43   
) -> std::result::Result<
   31     44   
    ::aws_smithy_http_server::response::Response,
   32     45   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   33     46   
> {
          47  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   34     48   
    Ok({
          49  +
        /* RustType.kt:516 */
   35     50   
        #[allow(unused_mut)]
          51  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   36     52   
        let mut builder = ::http::Response::builder();
          53  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   37     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   38     55   
            builder,
   39     56   
            ::http::header::CONTENT_TYPE,
   40     57   
            "application/json",
   41     58   
        );
          59  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   42     60   
        let http_status: u16 = 200;
   43     61   
        builder = builder.status(http_status);
          62  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   44     63   
        let payload =
   45         -
            crate::protocol_serde::shape_null_in_non_sparse_output::ser_null_in_non_sparse_output_output_output(&output)?
   46         -
        ;
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_null_in_non_sparse_output::ser_null_in_non_sparse_output_output_output(&output)?
          65  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          66  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   47     67   
        let content_length = payload.len();
   48     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   49     69   
            builder,
   50     70   
            ::http::header::CONTENT_LENGTH,
   51     71   
            content_length,
   52     72   
        );
          73  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   53     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   54     76   
        builder.body(body)?
          77  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   55     78   
    })
          79  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   56     80   
}
   57     81   
          82  +
/* RustType.kt:516 */
   58     83   
#[allow(clippy::unnecessary_wraps)]
          84  +
/* ServerHttpBoundProtocolGenerator.kt:447 */
   59     85   
pub fn ser_null_in_non_sparse_http_error(
   60     86   
    error: &crate::error::NullInNonSparseError,
   61     87   
) -> std::result::Result<
   62     88   
    ::aws_smithy_http_server::response::Response,
   63     89   
    ::aws_smithy_http_server::protocol::rest_json_1::rejection::ResponseRejection,
   64     90   
> {
          91  +
    /* ServerHttpBoundProtocolGenerator.kt:452 */
   65     92   
    Ok({
          93  +
        /* ServerHttpBoundProtocolGenerator.kt:468 */
   66     94   
        match error {
          95  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   67     96   
            crate::error::NullInNonSparseError::ExtraError(output) => {
          97  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   68     98   
                let payload =
   69     99   
                    crate::protocol_serde::shape_extra_error::ser_extra_error_error(output)?;
         100  +
                /* RustType.kt:516 */
   70    101   
                #[allow(unused_mut)]
         102  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   71    103   
                let mut builder = ::http::Response::builder();
         104  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   72    105   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   73    106   
                    builder,
   74    107   
                    ::http::header::CONTENT_TYPE,
   75    108   
                    "application/json",
   76    109   
                );
         110  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   77    111   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78    112   
                    builder,
   79    113   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
   80    114   
                    "ExtraError",
   81    115   
                );
         116  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
   82    117   
                let content_length = payload.len();
   83    118   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   84    119   
                    builder,
   85    120   
                    ::http::header::CONTENT_LENGTH,
   86    121   
                    content_length,
   87    122   
                );
         123  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
   88    124   
                builder
   89    125   
                    .status(500)
   90    126   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         127  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
   91    128   
            }
         129  +
            /* ServerHttpBoundProtocolGenerator.kt:476 */
   92    130   
            crate::error::NullInNonSparseError::InternalServerError(output) => {
         131  +
                /* ServerHttpBoundProtocolGenerator.kt:477 */
   93    132   
                let payload = crate::protocol_serde::shape_internal_server_error::ser_internal_server_error_error(output)?;
         133  +
                /* RustType.kt:516 */
   94    134   
                #[allow(unused_mut)]
         135  +
                /* ServerHttpBoundProtocolGenerator.kt:487 */
   95    136   
                let mut builder = ::http::Response::builder();
         137  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
   96    138   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
   97    139   
                    builder,
   98    140   
                    ::http::header::CONTENT_TYPE,
   99    141   
                    "application/json",
  100    142   
                );
         143  +
                /* ServerHttpBoundProtocolGenerator.kt:597 */
  101    144   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  102    145   
                    builder,
  103    146   
                    ::http::header::HeaderName::from_static("x-amzn-errortype"),
  104    147   
                    "InternalServerError",
  105    148   
                );
         149  +
                /* ServerHttpBoundProtocolGenerator.kt:663 */
  106    150   
                let content_length = payload.len();
  107    151   
                builder = ::aws_smithy_http::header::set_response_header_if_absent(
  108    152   
                    builder,
  109    153   
                    ::http::header::CONTENT_LENGTH,
  110    154   
                    content_length,
  111    155   
                );
         156  +
                /* ServerHttpBoundProtocolGenerator.kt:504 */
  112    157   
                builder
  113    158   
                    .status(500)
  114    159   
                    .body(::aws_smithy_http_server::body::to_boxed(payload))?
         160  +
                /* ServerHttpBoundProtocolGenerator.kt:476 */
         161  +
            } /* ServerHttpBoundProtocolGenerator.kt:468 */
  115    162   
        }
  116         -
        }
         163  +
        /* ServerHttpBoundProtocolGenerator.kt:452 */
  117    164   
    })
         165  +
    /* ServerHttpBoundProtocolGenerator.kt:447 */
  118    166   
}