Server Test

Server Test

rev. 4dfb3cf9797fd6c7a302d71b14fc801753358c72 (ignoring whitespace)

Files changed:

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

@@ -55,55 +115,115 @@
   75     75   
            builder,
   76     76   
            ::http_1x::header::CONTENT_TYPE,
   77     77   
            "text/plain",
   78     78   
        );
   79     79   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   80     80   
        let http_status: u16 = 200;
   81     81   
        builder = builder.status(http_status);
   82     82   
        /* ServerHttpBoundProtocolGenerator.kt:589 */
   83     83   
        let body = ::aws_smithy_http_server::body::boxed(::aws_smithy_http_server::body::wrap_stream(
   84     84   
            /* ServerProtocolLoader.kt:42 */::aws_smithy_http::futures_stream_adapter::FuturesStreamCompatByteStream::new(
   85         -
                /* HttpBoundProtocolPayloadGenerator.kt:348 */crate::protocol_serde::shape_streaming_traits_with_media_type_output::ser_blob_http_payload( output.blob)?
          85  +
                /* HttpBoundProtocolPayloadGenerator.kt:353 */crate::protocol_serde::shape_streaming_traits_with_media_type_output::ser_blob_http_payload( output.blob)?
   86     86   
            /* ServerProtocolLoader.kt:42 */)
   87     87   
        /* ServerHttpBoundProtocolGenerator.kt:589 */));
   88     88   
        /* ServerHttpBoundProtocolGenerator.kt:625 */
   89     89   
        builder.body(body)?
   90     90   
        /* ServerHttpBoundProtocolGenerator.kt:461 */
   91     91   
    })
   92     92   
    /* ServerHttpBoundProtocolGenerator.kt:449 */
   93     93   
}
   94     94   
   95     95   
/* HttpBindingGenerator.kt:565 */

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

@@ -1,1 +15,15 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/* HttpBoundProtocolPayloadGenerator.kt:309 */
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:314 */
    3      3   
pub fn ser_blob_http_payload(
    4      4   
    payload: ::aws_smithy_types::byte_stream::ByteStream,
    5      5   
) -> ::std::result::Result<
    6      6   
    ::aws_smithy_types::byte_stream::ByteStream,
    7      7   
    ::aws_smithy_types::error::operation::BuildError,
    8      8   
> {
    9         -
    /* HttpBoundProtocolPayloadGenerator.kt:343 */
           9  +
    /* HttpBoundProtocolPayloadGenerator.kt:348 */
   10     10   
    Ok(
   11         -
        /* HttpBoundProtocolPayloadGenerator.kt:372 */
   12         -
        payload, /* HttpBoundProtocolPayloadGenerator.kt:343 */
          11  +
        /* HttpBoundProtocolPayloadGenerator.kt:377 */
          12  +
        payload, /* HttpBoundProtocolPayloadGenerator.kt:348 */
   13     13   
    )
   14         -
    /* HttpBoundProtocolPayloadGenerator.kt:309 */
          14  +
    /* HttpBoundProtocolPayloadGenerator.kt:314 */
   15     15   
}

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

@@ -61,61 +121,121 @@
   81     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     82   
            builder,
   83     83   
            ::http_1x::header::CONTENT_TYPE,
   84     84   
            "application/json",
   85     85   
        );
   86     86   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   87     87   
        let http_status: u16 = 200;
   88     88   
        builder = builder.status(http_status);
   89     89   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   90     90   
        let payload =
   91         -
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_test_body_structure_output::ser_test_body_structure_output_output_output(&output)?
          91  +
            /* HttpBoundProtocolPayloadGenerator.kt:240 */crate::protocol_serde::shape_test_body_structure_output::ser_test_body_structure_output_output_output(&output)?
   92     92   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   93     93   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   94     94   
        let content_length = payload.len();
   95     95   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   96     96   
            builder,
   97     97   
            ::http_1x::header::CONTENT_LENGTH,
   98     98   
            content_length,
   99     99   
        );
  100    100   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
  101    101   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -36,36 +96,96 @@
   56     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     57   
            builder,
   58     58   
            ::http_1x::header::CONTENT_TYPE,
   59     59   
            "application/json",
   60     60   
        );
   61     61   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   62     62   
        let http_status: u16 = 200;
   63     63   
        builder = builder.status(http_status);
   64     64   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   65     65   
        let payload =
   66         -
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_test_get_no_input_no_payload_output::ser_test_get_no_input_no_payload_output_output_output(&output)?
          66  +
            /* HttpBoundProtocolPayloadGenerator.kt:240 */crate::protocol_serde::shape_test_get_no_input_no_payload_output::ser_test_get_no_input_no_payload_output_output_output(&output)?
   67     67   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   68     68   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   69     69   
        let content_length = payload.len();
   70     70   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71     71   
            builder,
   72     72   
            ::http_1x::header::CONTENT_LENGTH,
   73     73   
            content_length,
   74     74   
        );
   75     75   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   76     76   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -43,43 +103,103 @@
   63     63   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   64     64   
            builder,
   65     65   
            ::http_1x::header::CONTENT_TYPE,
   66     66   
            "application/json",
   67     67   
        );
   68     68   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   69     69   
        let http_status: u16 = 200;
   70     70   
        builder = builder.status(http_status);
   71     71   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   72     72   
        let payload =
   73         -
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_test_get_no_payload_output::ser_test_get_no_payload_output_output_output(&output)?
          73  +
            /* HttpBoundProtocolPayloadGenerator.kt:240 */crate::protocol_serde::shape_test_get_no_payload_output::ser_test_get_no_payload_output_output_output(&output)?
   74     74   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   75     75   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   76     76   
        let content_length = payload.len();
   77     77   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78     78   
            builder,
   79     79   
            ::http_1x::header::CONTENT_LENGTH,
   80     80   
            content_length,
   81     81   
        );
   82     82   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   83     83   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -47,47 +107,107 @@
   67     67   
        let mut builder = ::http_1x::Response::builder();
   68     68   
        /* ServerHttpBoundProtocolGenerator.kt:679 */
   69     69   
        builder = crate::protocol_serde::shape_test_payload_blob::ser_test_payload_blob_headers(
   70     70   
            &output, builder,
   71     71   
        )?;
   72     72   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   73     73   
        let http_status: u16 = 200;
   74     74   
        builder = builder.status(http_status);
   75     75   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   76     76   
        let payload =
   77         -
            /* HttpBoundProtocolPayloadGenerator.kt:348 */crate::protocol_serde::shape_test_payload_blob_output::ser_data_http_payload( output.data)?
          77  +
            /* HttpBoundProtocolPayloadGenerator.kt:353 */crate::protocol_serde::shape_test_payload_blob_output::ser_data_http_payload( output.data)?
   78     78   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   79     79   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   80     80   
        let content_length = payload.len();
   81     81   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   82     82   
            builder,
   83     83   
            ::http_1x::header::CONTENT_LENGTH,
   84     84   
            content_length,
   85     85   
        );
   86     86   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   87     87   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -1,1 +22,22 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/* HttpBoundProtocolPayloadGenerator.kt:309 */
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:314 */
    3      3   
pub fn ser_data_http_payload(
    4      4   
    payload: ::std::option::Option<::aws_smithy_types::Blob>,
    5      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
    6         -
    /* HttpBoundProtocolPayloadGenerator.kt:318 */
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:323 */
    7      7   
    let payload = match payload {
    8      8   
        Some(t) => t,
    9      9   
        None => {
   10     10   
            return Ok(
   11         -
                /* HttpBoundProtocolPayloadGenerator.kt:330 */
   12         -
                Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:318 */
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:335 */
          12  +
                Vec::new(), /* HttpBoundProtocolPayloadGenerator.kt:323 */
   13     13   
            )
   14     14   
        }
   15     15   
    };
   16         -
    /* HttpBoundProtocolPayloadGenerator.kt:343 */
          16  +
    /* HttpBoundProtocolPayloadGenerator.kt:348 */
   17     17   
    Ok(
   18         -
        /* HttpBoundProtocolPayloadGenerator.kt:375 */
   19         -
        payload.into_inner(), /* HttpBoundProtocolPayloadGenerator.kt:343 */
          18  +
        /* HttpBoundProtocolPayloadGenerator.kt:380 */
          19  +
        payload.into_inner(), /* HttpBoundProtocolPayloadGenerator.kt:348 */
   20     20   
    )
   21         -
    /* HttpBoundProtocolPayloadGenerator.kt:309 */
          21  +
    /* HttpBoundProtocolPayloadGenerator.kt:314 */
   22     22   
}

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

@@ -58,58 +118,118 @@
   78     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   79     79   
            builder,
   80     80   
            ::http_1x::header::CONTENT_TYPE,
   81     81   
            "application/json",
   82     82   
        );
   83     83   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   84     84   
        let http_status: u16 = 200;
   85     85   
        builder = builder.status(http_status);
   86     86   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   87     87   
        let payload =
   88         -
            /* HttpBoundProtocolPayloadGenerator.kt:348 */crate::protocol_serde::shape_test_payload_structure_output::ser_payload_config_http_payload(& output.payload_config)?
          88  +
            /* HttpBoundProtocolPayloadGenerator.kt:353 */crate::protocol_serde::shape_test_payload_structure_output::ser_payload_config_http_payload(& output.payload_config)?
   89     89   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   90     90   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   91     91   
        let content_length = payload.len();
   92     92   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   93     93   
            builder,
   94     94   
            ::http_1x::header::CONTENT_LENGTH,
   95     95   
            content_length,
   96     96   
        );
   97     97   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   98     98   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -1,1 +44,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
/* HttpBoundProtocolPayloadGenerator.kt:309 */
           2  +
/* HttpBoundProtocolPayloadGenerator.kt:314 */
    3      3   
pub fn ser_payload_config_http_payload(
    4      4   
    payload: &::std::option::Option<crate::model::PayloadConfig>,
    5      5   
) -> ::std::result::Result<::std::vec::Vec<u8>, ::aws_smithy_types::error::operation::BuildError> {
    6         -
    /* HttpBoundProtocolPayloadGenerator.kt:318 */
           6  +
    /* HttpBoundProtocolPayloadGenerator.kt:323 */
    7      7   
    let payload = match payload.as_ref() {
    8      8   
        Some(t) => t,
    9      9   
        None => {
   10     10   
            return Ok(
   11         -
                /* HttpBoundProtocolPayloadGenerator.kt:336 */
   12         -
                crate::protocol_serde::rest_json_unset_struct_payload(), /* HttpBoundProtocolPayloadGenerator.kt:318 */
          11  +
                /* HttpBoundProtocolPayloadGenerator.kt:341 */
          12  +
                crate::protocol_serde::rest_json_unset_struct_payload(), /* HttpBoundProtocolPayloadGenerator.kt:323 */
   13     13   
            )
   14     14   
        }
   15     15   
    };
   16         -
    /* HttpBoundProtocolPayloadGenerator.kt:343 */
          16  +
    /* HttpBoundProtocolPayloadGenerator.kt:348 */
   17     17   
    Ok(
   18         -
        /* HttpBoundProtocolPayloadGenerator.kt:384 */
          18  +
        /* HttpBoundProtocolPayloadGenerator.kt:389 */
   19     19   
        crate::protocol_serde::shape_test_payload_structure_output::ser_payload_config_payload(
   20     20   
            payload,
   21         -
        )?, /* HttpBoundProtocolPayloadGenerator.kt:343 */
          21  +
        )?, /* HttpBoundProtocolPayloadGenerator.kt:348 */
   22     22   
    )
   23         -
    /* HttpBoundProtocolPayloadGenerator.kt:309 */
          23  +
    /* HttpBoundProtocolPayloadGenerator.kt:314 */
   24     24   
}
   25     25   
   26     26   
/* JsonSerializerGenerator.kt:242 */
   27     27   
pub fn ser_payload_config_payload(
   28     28   
    input: &crate::model::PayloadConfig,
   29     29   
) -> std::result::Result<
   30     30   
    ::std::vec::Vec<u8>,
   31     31   
    ::aws_smithy_types::error::operation::SerializationError,
   32     32   
> {
   33     33   
    /* JsonSerializerGenerator.kt:247 */

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

@@ -36,36 +96,96 @@
   56     56   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   57     57   
            builder,
   58     58   
            ::http_1x::header::CONTENT_TYPE,
   59     59   
            "application/json",
   60     60   
        );
   61     61   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   62     62   
        let http_status: u16 = 200;
   63     63   
        builder = builder.status(http_status);
   64     64   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   65     65   
        let payload =
   66         -
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_test_post_no_input_no_payload_output::ser_test_post_no_input_no_payload_output_output_output(&output)?
          66  +
            /* HttpBoundProtocolPayloadGenerator.kt:240 */crate::protocol_serde::shape_test_post_no_input_no_payload_output::ser_test_post_no_input_no_payload_output_output_output(&output)?
   67     67   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   68     68   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   69     69   
        let content_length = payload.len();
   70     70   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   71     71   
            builder,
   72     72   
            ::http_1x::header::CONTENT_LENGTH,
   73     73   
            content_length,
   74     74   
        );
   75     75   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   76     76   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -43,43 +103,103 @@
   63     63   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   64     64   
            builder,
   65     65   
            ::http_1x::header::CONTENT_TYPE,
   66     66   
            "application/json",
   67     67   
        );
   68     68   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   69     69   
        let http_status: u16 = 200;
   70     70   
        builder = builder.status(http_status);
   71     71   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   72     72   
        let payload =
   73         -
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_test_post_no_payload_output::ser_test_post_no_payload_output_output_output(&output)?
          73  +
            /* HttpBoundProtocolPayloadGenerator.kt:240 */crate::protocol_serde::shape_test_post_no_payload_output::ser_test_post_no_payload_output_output_output(&output)?
   74     74   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   75     75   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   76     76   
        let content_length = payload.len();
   77     77   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   78     78   
            builder,
   79     79   
            ::http_1x::header::CONTENT_LENGTH,
   80     80   
            content_length,
   81     81   
        );
   82     82   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   83     83   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -82,82 +142,142 @@
  102    102   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  103    103   
            builder,
  104    104   
            ::http_1x::header::CONTENT_TYPE,
  105    105   
            "application/json",
  106    106   
        );
  107    107   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
  108    108   
        let http_status: u16 = 200;
  109    109   
        builder = builder.status(http_status);
  110    110   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
  111    111   
        let payload =
  112         -
            /* HttpBoundProtocolPayloadGenerator.kt:235 */crate::protocol_serde::shape_timestamp_format_headers_output::ser_timestamp_format_headers_output_output_output(&output)?
         112  +
            /* HttpBoundProtocolPayloadGenerator.kt:240 */crate::protocol_serde::shape_timestamp_format_headers_output::ser_timestamp_format_headers_output_output_output(&output)?
  113    113   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
  114    114   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
  115    115   
        let content_length = payload.len();
  116    116   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
  117    117   
            builder,
  118    118   
            ::http_1x::header::CONTENT_LENGTH,
  119    119   
            content_length,
  120    120   
        );
  121    121   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
  122    122   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);

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

@@ -34,34 +80,80 @@
   54     54   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     55   
            builder,
   56     56   
            ::http_1x::header::CONTENT_TYPE,
   57     57   
            "application/json",
   58     58   
        );
   59     59   
        /* ServerHttpBoundProtocolGenerator.kt:732 */
   60     60   
        let http_status: u16 = 200;
   61     61   
        builder = builder.status(http_status);
   62     62   
        /* ServerHttpBoundProtocolGenerator.kt:611 */
   63     63   
        let payload =
   64         -
            /* HttpBoundProtocolPayloadGenerator.kt:233 */""
          64  +
            /* HttpBoundProtocolPayloadGenerator.kt:238 */""
   65     65   
        /* ServerHttpBoundProtocolGenerator.kt:611 */;
   66     66   
        /* ServerHttpBoundProtocolGenerator.kt:713 */
   67     67   
        let content_length = payload.len();
   68     68   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   69     69   
            builder,
   70     70   
            ::http_1x::header::CONTENT_LENGTH,
   71     71   
            content_length,
   72     72   
        );
   73     73   
        /* ServerHttpBoundProtocolGenerator.kt:617 */
   74     74   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);