Server Test Python

Server Test Python

rev. b0deb0ffbc7c5574d778848fd7fb7baea5d1724c

Files changed:

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

@@ -22,22 +82,81 @@
   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_QUERYPRECEDENCE,
   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_query_precedence::de_query_precedence_http_request(request)
   51     51   
                .await
   52         -
                .map_err(Into::into)
   53     52   
        };
   54     53   
        use ::futures_util::future::TryFutureExt;
   55     54   
        let fut = fut.map_err(
   56     55   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   57     56   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   58     57   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     58   
                    e,
   60     59   
                )
   61     60   
            },
   62     61   
        );
@@ -127,126 +187,185 @@
  147    146   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  148    147   
        let fut = async move {
  149    148   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  150    149   
                request.headers(),
  151    150   
                &CONTENT_TYPE_EMPTYSTRUCTWITHCONTENTONWIREOP,
  152    151   
            ) {
  153    152   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  154    153   
            }
  155    154   
            crate::protocol_serde::shape_empty_struct_with_content_on_wire_op::de_empty_struct_with_content_on_wire_op_http_request(request)
  156    155   
                            .await
  157         -
                            .map_err(Into::into)
  158    156   
        };
  159    157   
        use ::futures_util::future::TryFutureExt;
  160    158   
        let fut = fut.map_err(
  161    159   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  162    160   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  163    161   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  164    162   
                    e,
  165    163   
                )
  166    164   
            },
  167    165   
        );
@@ -227,225 +287,284 @@
  247    245   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  248    246   
        let fut = async move {
  249    247   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  250    248   
                request.headers(),
  251    249   
                &CONTENT_TYPE_CASEINSENSITIVEERROROPERATION,
  252    250   
            ) {
  253    251   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  254    252   
            }
  255    253   
            crate::protocol_serde::shape_case_insensitive_error_operation::de_case_insensitive_error_operation_http_request(request)
  256    254   
                            .await
  257         -
                            .map_err(Into::into)
  258    255   
        };
  259    256   
        use ::futures_util::future::TryFutureExt;
  260    257   
        let fut = fut.map_err(
  261    258   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  262    259   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  263    260   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  264    261   
                    e,
  265    262   
                )
  266    263   
            },
  267    264   
        );
@@ -329,326 +389,385 @@
  349    346   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  350    347   
                request.headers(),
  351    348   
                &CONTENT_TYPE_NULLINNONSPARSE,
  352    349   
            ) {
  353    350   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  354    351   
            }
  355    352   
            crate::protocol_serde::shape_null_in_non_sparse::de_null_in_non_sparse_http_request(
  356    353   
                request,
  357    354   
            )
  358    355   
            .await
  359         -
            .map_err(Into::into)
  360    356   
        };
  361    357   
        use ::futures_util::future::TryFutureExt;
  362    358   
        let fut = fut.map_err(
  363    359   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  364    360   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  365    361   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  366    362   
                    e,
  367    363   
                )
  368    364   
            },
  369    365   
        );
@@ -435,431 +495,490 @@
  455    451   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  456    452   
        let fut = async move {
  457    453   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  458    454   
                request.headers(),
  459    455   
                &CONTENT_TYPE_ESCAPEDSTRINGVALUES,
  460    456   
            ) {
  461    457   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  462    458   
            }
  463    459   
            crate::protocol_serde::shape_escaped_string_values::de_escaped_string_values_http_request(request)
  464    460   
                            .await
  465         -
                            .map_err(Into::into)
  466    461   
        };
  467    462   
        use ::futures_util::future::TryFutureExt;
  468    463   
        let fut = fut.map_err(
  469    464   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  470    465   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  471    466   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  472    467   
                    e,
  473    468   
                )
  474    469   
            },
  475    470   
        );
@@ -535,530 +595,589 @@
  555    550   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  556    551   
        let fut = async move {
  557    552   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  558    553   
                request.headers(),
  559    554   
                &CONTENT_TYPE_PRIMITIVEINTOP,
  560    555   
            ) {
  561    556   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  562    557   
            }
  563    558   
            crate::protocol_serde::shape_primitive_int_op::de_primitive_int_op_http_request(request)
  564    559   
                .await
  565         -
                .map_err(Into::into)
  566    560   
        };
  567    561   
        use ::futures_util::future::TryFutureExt;
  568    562   
        let fut = fut.map_err(
  569    563   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  570    564   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  571    565   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  572    566   
                    e,
  573    567   
                )
  574    568   
            },
  575    569   
        );
@@ -642,636 +702,695 @@
  662    656   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  663    657   
                request.headers(),
  664    658   
                &CONTENT_TYPE_MAPWITHENUMKEYOP,
  665    659   
            ) {
  666    660   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  667    661   
            }
  668    662   
            crate::protocol_serde::shape_map_with_enum_key_op::de_map_with_enum_key_op_http_request(
  669    663   
                request,
  670    664   
            )
  671    665   
            .await
  672         -
            .map_err(Into::into)
  673    666   
        };
  674    667   
        use ::futures_util::future::TryFutureExt;
  675    668   
        let fut = fut.map_err(
  676    669   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  677    670   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  678    671   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  679    672   
                    e,
  680    673   
                )
  681    674   
            },
  682    675   
        );
@@ -746,739 +806,798 @@
  766    759   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  767    760   
        let fut = async move {
  768    761   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  769    762   
                request.headers(),
  770    763   
                &CONTENT_TYPE_STATUSRESPONSE,
  771    764   
            ) {
  772    765   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  773    766   
            }
  774    767   
            crate::protocol_serde::shape_status_response::de_status_response_http_request(request)
  775    768   
                .await
  776         -
                .map_err(Into::into)
  777    769   
        };
  778    770   
        use ::futures_util::future::TryFutureExt;
  779    771   
        let fut = fut.map_err(
  780    772   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  781    773   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  782    774   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  783    775   
                    e,
  784    776   
                )
  785    777   
            },
  786    778   
        );
@@ -847,839 +909,899 @@
  867    859   
    type Future = EnumQueryInputFuture;
  868    860   
  869    861   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
  870    862   
        let fut = async move {
  871    863   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  872    864   
                request.headers(),
  873    865   
                &CONTENT_TYPE_ENUMQUERY,
  874    866   
            ) {
  875    867   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  876    868   
            }
  877         -
            crate::protocol_serde::shape_enum_query::de_enum_query_http_request(request)
  878         -
                .await
  879         -
                .map_err(Into::into)
         869  +
            crate::protocol_serde::shape_enum_query::de_enum_query_http_request(request).await
  880    870   
        };
  881    871   
        use ::futures_util::future::TryFutureExt;
  882    872   
        let fut = fut.map_err(
  883    873   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  884    874   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  885    875   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  886    876   
                    e,
  887    877   
                )
  888    878   
            },
  889    879   
        );
@@ -953,943 +1013,1002 @@
  973    963   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
  974    964   
                request.headers(),
  975    965   
                &CONTENT_TYPE_PRIMITIVEINTHEADER,
  976    966   
            ) {
  977    967   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
  978    968   
            }
  979    969   
            crate::protocol_serde::shape_primitive_int_header::de_primitive_int_header_http_request(
  980    970   
                request,
  981    971   
            )
  982    972   
            .await
  983         -
            .map_err(Into::into)
  984    973   
        };
  985    974   
        use ::futures_util::future::TryFutureExt;
  986    975   
        let fut = fut.map_err(
  987    976   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
  988    977   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  989    978   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  990    979   
                    e,
  991    980   
                )
  992    981   
            },
  993    982   
        );
@@ -1062,1051 +1122,1110 @@
 1082   1071   
    fn from_request(request: ::http::Request<B>) -> Self::Future {
 1083   1072   
        let fut = async move {
 1084   1073   
            if !::aws_smithy_http_server::protocol::accept_header_classifier(
 1085   1074   
                request.headers(),
 1086   1075   
                &CONTENT_TYPE_STRINGPAYLOAD,
 1087   1076   
            ) {
 1088   1077   
                return Err(::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection::NotAcceptable);
 1089   1078   
            }
 1090   1079   
            crate::protocol_serde::shape_string_payload::de_string_payload_http_request(request)
 1091   1080   
                .await
 1092         -
                .map_err(Into::into)
 1093   1081   
        };
 1094   1082   
        use ::futures_util::future::TryFutureExt;
 1095   1083   
        let fut = fut.map_err(
 1096   1084   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
 1097   1085   
                ::tracing::debug!(error = %e, "failed to deserialize request");
 1098   1086   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 1099   1087   
                    e,
 1100   1088   
                )
 1101   1089   
            },
 1102   1090   
        );

tmp-codegen-diff/codegen-server-test-python/simple/rust-server-codegen-python/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   
        );

tmp-codegen-diff/codegen-server-test-python/unique_items/rust-server-codegen-python/src/operation.rs

@@ -22,22 +82,81 @@
   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_MALFORMEDUNIQUEITEMS,
   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_malformed_unique_items::de_malformed_unique_items_http_request(request)
   51     51   
                            .await
   52         -
                            .map_err(Into::into)
   53     52   
        };
   54     53   
        use ::futures_util::future::TryFutureExt;
   55     54   
        let fut = fut.map_err(
   56     55   
            |e: ::aws_smithy_http_server::protocol::rest_json_1::rejection::RequestRejection| {
   57     56   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   58     57   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   59     58   
                    e,
   60     59   
                )
   61     60   
            },
   62     61   
        );