Server Test Typescript

Server Test Typescript

rev. b439bcba7c1ed0789341e9e7b416682ed5a8c82a (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test-typescript/pokemon-service-server-sdk/rust-server-codegen-typescript/src/operation.rs

@@ -24,24 +84,83 @@
   44     44   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &CONTENT_TYPE_GETPOKEMONSPECIES,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50     50   
            crate::protocol_serde::shape_get_pokemon_species::de_get_pokemon_species_http_request(
   51     51   
                request,
   52     52   
            )
   53     53   
            .await
   54         -
            .map_err(Into::into)
   55     54   
        };
   56     55   
        use ::futures_util::future::TryFutureExt;
   57     56   
        let fut = fut.map_err(
   58     57   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   59     58   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   60     59   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   61     60   
                    e,
   62     61   
                )
   63     62   
            },
   64     63   
        );
@@ -126,125 +188,185 @@
  146    145   
    type Future = CheckHealthInputFuture;
  147    146   
  148    147   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  149    148   
        let fut = async move {
  150    149   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  151    150   
                request.headers(),
  152    151   
                &CONTENT_TYPE_CHECKHEALTH,
  153    152   
            ) {
  154    153   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  155    154   
            }
  156         -
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request)
  157         -
                .await
  158         -
                .map_err(Into::into)
         155  +
            crate::protocol_serde::shape_check_health::de_check_health_http_request(request).await
  159    156   
        };
  160    157   
        use ::futures_util::future::TryFutureExt;
  161    158   
        let fut = fut.map_err(
  162    159   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  163    160   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  164    161   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  165    162   
                    e,
  166    163   
                )
  167    164   
            },
  168    165   
        );
@@ -228,225 +290,285 @@
  248    245   
    type Future = DoNothingInputFuture;
  249    246   
  250    247   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  251    248   
        let fut = async move {
  252    249   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  253    250   
                request.headers(),
  254    251   
                &CONTENT_TYPE_DONOTHING,
  255    252   
            ) {
  256    253   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  257    254   
            }
  258         -
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request)
  259         -
                .await
  260         -
                .map_err(Into::into)
         255  +
            crate::protocol_serde::shape_do_nothing::de_do_nothing_http_request(request).await
  261    256   
        };
  262    257   
        use ::futures_util::future::TryFutureExt;
  263    258   
        let fut = fut.map_err(
  264    259   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  265    260   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  266    261   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  267    262   
                    e,
  268    263   
                )
  269    264   
            },
  270    265   
        );
@@ -332,327 +392,386 @@
  352    347   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  353    348   
        let fut = async move {
  354    349   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  355    350   
                request.headers(),
  356    351   
                &CONTENT_TYPE_GETSERVERSTATISTICS,
  357    352   
            ) {
  358    353   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  359    354   
            }
  360    355   
            crate::protocol_serde::shape_get_server_statistics::de_get_server_statistics_http_request(request)
  361    356   
                            .await
  362         -
                            .map_err(Into::into)
  363    357   
        };
  364    358   
        use ::futures_util::future::TryFutureExt;
  365    359   
        let fut = fut.map_err(
  366    360   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  367    361   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  368    362   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  369    363   
                    e,
  370    364   
                )
  371    365   
            },
  372    366   
        );

tmp-codegen-diff/codegen-server-test-typescript/simple/rust-server-codegen-typescript/src/operation.rs

@@ -20,20 +82,80 @@
   40     40   
    type Future = OperationInputFuture;
   41     41   
   42     42   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
   43     43   
        let fut = async move {
   44     44   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
   45     45   
                request.headers(),
   46     46   
                &CONTENT_TYPE_OPERATION,
   47     47   
            ) {
   48     48   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
   49     49   
            }
   50         -
            crate::protocol_serde::shape_operation::de_operation_http_request(request)
   51         -
                .await
   52         -
                .map_err(Into::into)
          50  +
            crate::protocol_serde::shape_operation::de_operation_http_request(request).await
   53     51   
        };
   54     52   
        use ::futures_util::future::TryFutureExt;
   55     53   
        let fut = fut.map_err(
   56     54   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   57     55   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   58     56   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     57   
                    e,
   60     58   
                )
   61     59   
            },
   62     60   
        );