Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

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

@@ -1,1 +31,32 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
    2      3   
const CONTENT_TYPE_SENSITIVEVALIDATION: ::mime::Mime = ::mime::APPLICATION_JSON;
    3      4   
::pin_project_lite::pin_project! {
    4      5   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    5      6   
    /// [`SensitiveValidationInput`](crate::input::SensitiveValidationInput) using modelled bindings.
    6      7   
    pub struct SensitiveValidationInputFuture {
    7      8   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::SensitiveValidationInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
    8      9   
    }
    9     10   
}
   10     11   
   11     12   
impl std::future::Future for SensitiveValidationInputFuture {
@@ -40,41 +195,204 @@
   60     61   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
   61     62   
                    e,
   62     63   
                )
   63     64   
            },
   64     65   
        );
   65     66   
        SensitiveValidationInputFuture {
   66     67   
            inner: Box::pin(fut),
   67     68   
        }
   68     69   
    }
   69     70   
}
          71  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
   70     72   
impl
   71     73   
    ::aws_smithy_http_server::response::IntoResponse<
   72     74   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   73     75   
    > for crate::output::SensitiveValidationOutput
   74     76   
{
   75     77   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   76     78   
        match crate::protocol_serde::shape_sensitive_validation::ser_sensitive_validation_http_response(self) {
   77     79   
                        Ok(response) => response,
   78     80   
                        Err(e) => {
   79     81   
                            ::tracing::error!(error = %e, "failed to serialize response");
   80     82   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
   81     83   
                        }
   82     84   
                    }
   83     85   
    }
   84     86   
}
          87  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
   85     88   
impl
   86     89   
    ::aws_smithy_http_server::response::IntoResponse<
   87     90   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
   88     91   
    > for crate::error::SensitiveValidationError
   89     92   
{
   90     93   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   91     94   
        match crate::protocol_serde::shape_sensitive_validation::ser_sensitive_validation_http_error(
   92     95   
            &self,
   93     96   
        ) {
   94     97   
            Ok(mut response) => {
   95     98   
                response.extensions_mut().insert(
   96     99   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
   97    100   
                );
   98    101   
                response
   99    102   
            }
  100    103   
            Err(e) => {
  101    104   
                ::tracing::error!(error = %e, "failed to serialize response");
  102    105   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  103    106   
            }
  104    107   
        }
  105    108   
    }
  106    109   
}
  107    110   
         111  +
/* RustType.kt:516 */
  108    112   
#[allow(unreachable_code, unused_variables)]
         113  +
/* RustType.kt:516 */
  109    114   
#[cfg(test)]
         115  +
/* ProtocolTestGenerator.kt:98 */
  110    116   
mod sensitive_validation_test {
  111    117   
  112    118   
    /// When a sensitive member fails validation, the resultant
  113    119   
    /// ValidationException will omit the value of the input.
  114    120   
    /// Test ID: RestJsonMalformedPatternSensitiveString
  115    121   
    #[::tokio::test]
  116    122   
    #[::tracing_test::traced_test]
  117    123   
    async fn rest_json_malformed_pattern_sensitive_string_malformed_request() {
  118    124   
        {
  119    125   
            #[allow(unused_mut)]
  120    126   
            let mut http_request = http::Request::builder()
  121    127   
                .uri("/SensitiveValidation")
  122    128   
                .method("POST")
  123    129   
                .header("content-type", "application/json")
  124    130   
                .body(::aws_smithy_http_server::body::Body::from(
  125    131   
                    ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  126    132   
                        "{ \"string\" : \"ABC\" }".as_bytes(),
  127    133   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
  128    134   
                    )),
  129    135   
                ))
  130    136   
                .unwrap();
  131    137   
            #[allow(unused_mut)]
  132    138   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  133    139   
            let config = crate::service::RestJsonValidationConfig::builder().build();
  134    140   
            let service = crate::service::RestJsonValidation::builder::<::hyper::body::Body, _, _, _>(config)
  135    141   
                            .sensitive_validation(move |input: crate::input::SensitiveValidationInput| {
  136    142   
                                let sender = sender.clone();
  137    143   
                                async move {
  138    144   
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::SensitiveValidationOutput, crate::error::SensitiveValidationError> };
  139    145   
                                    sender.send(()).await.expect("receiver dropped early");
  140    146   
                                    result
  141    147   
                                }
  142    148   
                            })
  143    149   
                            .build_unchecked();
  144    150   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  145    151   
                .await
  146    152   
                .expect("unable to make an HTTP request");
  147    153   
            ::pretty_assertions::assert_eq!(
  148    154   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
  149    155   
                http_response.status()
  150    156   
            );
  151    157   
            let expected_headers = [("x-amzn-errortype", "ValidationException")];
  152    158   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
  153    159   
                http_response.headers(),
  154    160   
                expected_headers,
  155    161   
            ));
  156    162   
            let body = ::hyper::body::to_bytes(http_response.into_body())
  157    163   
                .await
  158    164   
                .expect("unable to extract body to bytes");
  159    165   
            ::aws_smithy_protocol_test::assert_ok(
  160    166   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\",\n  \"fieldList\" : [{\"message\": \"Value at '/string' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/string\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  161    167   
            );
  162    168   
        }
  163    169   
    }
         170  +
         171  +
    /* ProtocolTestGenerator.kt:98 */
  164    172   
}
  165    173   
         174  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  166    175   
const CONTENT_TYPE_RECURSIVESTRUCTURES: ::mime::Mime = ::mime::APPLICATION_JSON;
  167    176   
::pin_project_lite::pin_project! {
  168    177   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  169    178   
    /// [`RecursiveStructuresInput`](crate::input::RecursiveStructuresInput) using modelled bindings.
  170    179   
    pub struct RecursiveStructuresInputFuture {
  171    180   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RecursiveStructuresInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  172    181   
    }
  173    182   
}
  174    183   
  175    184   
impl std::future::Future for RecursiveStructuresInputFuture {
@@ -204,213 +303,317 @@
  224    233   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  225    234   
                    e,
  226    235   
                )
  227    236   
            },
  228    237   
        );
  229    238   
        RecursiveStructuresInputFuture {
  230    239   
            inner: Box::pin(fut),
  231    240   
        }
  232    241   
    }
  233    242   
}
         243  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  234    244   
impl
  235    245   
    ::aws_smithy_http_server::response::IntoResponse<
  236    246   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  237    247   
    > for crate::output::RecursiveStructuresOutput
  238    248   
{
  239    249   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  240    250   
        match crate::protocol_serde::shape_recursive_structures::ser_recursive_structures_http_response(self) {
  241    251   
                        Ok(response) => response,
  242    252   
                        Err(e) => {
  243    253   
                            ::tracing::error!(error = %e, "failed to serialize response");
  244    254   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  245    255   
                        }
  246    256   
                    }
  247    257   
    }
  248    258   
}
         259  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  249    260   
impl
  250    261   
    ::aws_smithy_http_server::response::IntoResponse<
  251    262   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  252    263   
    > for crate::error::RecursiveStructuresError
  253    264   
{
  254    265   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  255    266   
        match crate::protocol_serde::shape_recursive_structures::ser_recursive_structures_http_error(
  256    267   
            &self,
  257    268   
        ) {
  258    269   
            Ok(mut response) => {
  259    270   
                response.extensions_mut().insert(
  260    271   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  261    272   
                );
  262    273   
                response
  263    274   
            }
  264    275   
            Err(e) => {
  265    276   
                ::tracing::error!(error = %e, "failed to serialize response");
  266    277   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  267    278   
            }
  268    279   
        }
  269    280   
    }
  270    281   
}
  271    282   
         283  +
/* RustType.kt:516 */
  272    284   
#[allow(unreachable_code, unused_variables)]
         285  +
/* RustType.kt:516 */
  273    286   
#[cfg(test)]
         287  +
/* ProtocolTestGenerator.kt:98 */
  274    288   
mod recursive_structures_test {
  275    289   
  276    290   
    /// Validation should work with recursive structures.
  277    291   
    /// Test ID: RestJsonRecursiveStructuresValidate
  278    292   
    #[::tokio::test]
  279    293   
    #[::tracing_test::traced_test]
  280    294   
    async fn rest_json_recursive_structures_validate_request() {
  281    295   
        #[allow(unused_mut)]
  282    296   
                    let mut http_request = http::Request::builder()
  283    297   
                        .uri("/RecursiveStructures")
@@ -351,365 +412,429 @@
  371    385   
                expected_headers,
  372    386   
            ));
  373    387   
            let body = ::hyper::body::to_bytes(http_response.into_body())
  374    388   
                .await
  375    389   
                .expect("unable to extract body to bytes");
  376    390   
            ::aws_smithy_protocol_test::assert_ok(
  377    391   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/union/union/union/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\",\n  \"fieldList\" : [{\"message\": \"Value at '/union/union/union/string' failed to satisfy constraint: Member must satisfy enum value set: [abc, def]\", \"path\": \"/union/union/union/string\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
  378    392   
            );
  379    393   
        }
  380    394   
    }
         395  +
         396  +
    /* ProtocolTestGenerator.kt:98 */
  381    397   
}
  382    398   
         399  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  383    400   
const CONTENT_TYPE_MALFORMEDUNIQUEITEMS: ::mime::Mime = ::mime::APPLICATION_JSON;
  384    401   
::pin_project_lite::pin_project! {
  385    402   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  386    403   
    /// [`MalformedUniqueItemsInput`](crate::input::MalformedUniqueItemsInput) using modelled bindings.
  387    404   
    pub struct MalformedUniqueItemsInputFuture {
  388    405   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedUniqueItemsInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
  389    406   
    }
  390    407   
}
  391    408   
  392    409   
impl std::future::Future for MalformedUniqueItemsInputFuture {
@@ -419,436 +514,536 @@
  439    456   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
  440    457   
                    e,
  441    458   
                )
  442    459   
            },
  443    460   
        );
  444    461   
        MalformedUniqueItemsInputFuture {
  445    462   
            inner: Box::pin(fut),
  446    463   
        }
  447    464   
    }
  448    465   
}
         466  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  449    467   
impl
  450    468   
    ::aws_smithy_http_server::response::IntoResponse<
  451    469   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  452    470   
    > for crate::output::MalformedUniqueItemsOutput
  453    471   
{
  454    472   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  455    473   
        match crate::protocol_serde::shape_malformed_unique_items::ser_malformed_unique_items_http_response(self) {
  456    474   
                        Ok(response) => response,
  457    475   
                        Err(e) => {
  458    476   
                            ::tracing::error!(error = %e, "failed to serialize response");
  459    477   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  460    478   
                        }
  461    479   
                    }
  462    480   
    }
  463    481   
}
         482  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  464    483   
impl
  465    484   
    ::aws_smithy_http_server::response::IntoResponse<
  466    485   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
  467    486   
    > for crate::error::MalformedUniqueItemsError
  468    487   
{
  469    488   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  470    489   
        match crate::protocol_serde::shape_malformed_unique_items::ser_malformed_unique_items_http_error(&self) {
  471    490   
            Ok(mut response) => {
  472    491   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
  473    492   
                response
  474    493   
            },
  475    494   
            Err(e) => {
  476    495   
                ::tracing::error!(error = %e, "failed to serialize response");
  477    496   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
  478    497   
            }
  479    498   
        }
  480    499   
    }
  481    500   
}
  482    501   
         502  +
/* RustType.kt:516 */
  483    503   
#[allow(unreachable_code, unused_variables)]
         504  +
/* RustType.kt:516 */
  484    505   
#[cfg(test)]
         506  +
/* ProtocolTestGenerator.kt:98 */
  485    507   
mod malformed_unique_items_test {
  486    508   
  487    509   
    /// When a blob list contains non-unique values,
  488    510   
    /// the response should be a 400 ValidationException.
  489    511   
    /// Test ID: RestJsonMalformedUniqueItemsBlobList
  490    512   
    #[::tokio::test]
  491    513   
    #[::tracing_test::traced_test]
  492    514   
    #[should_panic]
  493    515   
    async fn rest_json_malformed_unique_items_blob_list_malformed_request() {
  494    516   
        {
@@ -1426,1448 +1487,1512 @@
 1446   1468   
                expected_headers,
 1447   1469   
            ));
 1448   1470   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 1449   1471   
                .await
 1450   1472   
                .expect("unable to extract body to bytes");
 1451   1473   
            ::aws_smithy_protocol_test::assert_ok(
 1452   1474   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/unionList' failed to satisfy constraint: Member must have unique values\",\n  \"fieldList\" : [{\"message\": \"Value at '/unionList' failed to satisfy constraint: Member must have unique values\", \"path\": \"/unionList\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 1453   1475   
            );
 1454   1476   
        }
 1455   1477   
    }
        1478  +
        1479  +
    /* ProtocolTestGenerator.kt:98 */
 1456   1480   
}
 1457   1481   
        1482  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 1458   1483   
const CONTENT_TYPE_MALFORMEDREQUIRED: ::mime::Mime = ::mime::APPLICATION_JSON;
 1459   1484   
::pin_project_lite::pin_project! {
 1460   1485   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1461   1486   
    /// [`MalformedRequiredInput`](crate::input::MalformedRequiredInput) using modelled bindings.
 1462   1487   
    pub struct MalformedRequiredInputFuture {
 1463   1488   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedRequiredInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1464   1489   
    }
 1465   1490   
}
 1466   1491   
 1467   1492   
impl std::future::Future for MalformedRequiredInputFuture {
@@ -1496,1521 +1597,1627 @@
 1516   1541   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 1517   1542   
                    e,
 1518   1543   
                )
 1519   1544   
            },
 1520   1545   
        );
 1521   1546   
        MalformedRequiredInputFuture {
 1522   1547   
            inner: Box::pin(fut),
 1523   1548   
        }
 1524   1549   
    }
 1525   1550   
}
        1551  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 1526   1552   
impl
 1527   1553   
    ::aws_smithy_http_server::response::IntoResponse<
 1528   1554   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1529   1555   
    > for crate::output::MalformedRequiredOutput
 1530   1556   
{
 1531   1557   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 1532   1558   
        match crate::protocol_serde::shape_malformed_required::ser_malformed_required_http_response(
 1533   1559   
            self,
 1534   1560   
        ) {
 1535   1561   
            Ok(response) => response,
 1536   1562   
            Err(e) => {
 1537   1563   
                ::tracing::error!(error = %e, "failed to serialize response");
 1538   1564   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 1539   1565   
            }
 1540   1566   
        }
 1541   1567   
    }
 1542   1568   
}
        1569  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 1543   1570   
impl
 1544   1571   
    ::aws_smithy_http_server::response::IntoResponse<
 1545   1572   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1546   1573   
    > for crate::error::MalformedRequiredError
 1547   1574   
{
 1548   1575   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 1549   1576   
        match crate::protocol_serde::shape_malformed_required::ser_malformed_required_http_error(
 1550   1577   
            &self,
 1551   1578   
        ) {
 1552   1579   
            Ok(mut response) => {
 1553   1580   
                response.extensions_mut().insert(
 1554   1581   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 1555   1582   
                );
 1556   1583   
                response
 1557   1584   
            }
 1558   1585   
            Err(e) => {
 1559   1586   
                ::tracing::error!(error = %e, "failed to serialize response");
 1560   1587   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 1561   1588   
            }
 1562   1589   
        }
 1563   1590   
    }
 1564   1591   
}
 1565   1592   
        1593  +
/* RustType.kt:516 */
 1566   1594   
#[allow(unreachable_code, unused_variables)]
        1595  +
/* RustType.kt:516 */
 1567   1596   
#[cfg(test)]
        1597  +
/* ProtocolTestGenerator.kt:98 */
 1568   1598   
mod malformed_required_test {
 1569   1599   
 1570   1600   
    /// When a required member is not set in the message body,
 1571   1601   
    /// the response should be a 400 ValidationException.
 1572   1602   
    /// Test ID: RestJsonMalformedRequiredBodyUnset
 1573   1603   
    #[::tokio::test]
 1574   1604   
    #[::tracing_test::traced_test]
 1575   1605   
    async fn rest_json_malformed_required_body_unset_malformed_request() {
 1576   1606   
        {
 1577   1607   
            #[allow(unused_mut)]
@@ -1703,1733 +1764,1797 @@
 1723   1753   
                expected_headers,
 1724   1754   
            ));
 1725   1755   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 1726   1756   
                .await
 1727   1757   
                .expect("unable to extract body to bytes");
 1728   1758   
            ::aws_smithy_protocol_test::assert_ok(
 1729   1759   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/stringInHeader' failed to satisfy constraint: Member must not be null\",\n  \"fieldList\" : [{\"message\": \"Value at '/stringInHeader' failed to satisfy constraint: Member must not be null\", \"path\": \"/stringInHeader\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 1730   1760   
            );
 1731   1761   
        }
 1732   1762   
    }
        1763  +
        1764  +
    /* ProtocolTestGenerator.kt:98 */
 1733   1765   
}
 1734   1766   
        1767  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 1735   1768   
const CONTENT_TYPE_MALFORMEDRANGEOVERRIDE: ::mime::Mime = ::mime::APPLICATION_JSON;
 1736   1769   
::pin_project_lite::pin_project! {
 1737   1770   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 1738   1771   
    /// [`MalformedRangeOverrideInput`](crate::input::MalformedRangeOverrideInput) using modelled bindings.
 1739   1772   
    pub struct MalformedRangeOverrideInputFuture {
 1740   1773   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedRangeOverrideInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 1741   1774   
    }
 1742   1775   
}
 1743   1776   
 1744   1777   
impl std::future::Future for MalformedRangeOverrideInputFuture {
@@ -1771,1804 +1866,1904 @@
 1791   1824   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 1792   1825   
                    e,
 1793   1826   
                )
 1794   1827   
            },
 1795   1828   
        );
 1796   1829   
        MalformedRangeOverrideInputFuture {
 1797   1830   
            inner: Box::pin(fut),
 1798   1831   
        }
 1799   1832   
    }
 1800   1833   
}
        1834  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 1801   1835   
impl
 1802   1836   
    ::aws_smithy_http_server::response::IntoResponse<
 1803   1837   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1804   1838   
    > for crate::output::MalformedRangeOverrideOutput
 1805   1839   
{
 1806   1840   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 1807   1841   
        match crate::protocol_serde::shape_malformed_range_override::ser_malformed_range_override_http_response(self) {
 1808   1842   
                        Ok(response) => response,
 1809   1843   
                        Err(e) => {
 1810   1844   
                            ::tracing::error!(error = %e, "failed to serialize response");
 1811   1845   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 1812   1846   
                        }
 1813   1847   
                    }
 1814   1848   
    }
 1815   1849   
}
        1850  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 1816   1851   
impl
 1817   1852   
    ::aws_smithy_http_server::response::IntoResponse<
 1818   1853   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 1819   1854   
    > for crate::error::MalformedRangeOverrideError
 1820   1855   
{
 1821   1856   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 1822   1857   
        match crate::protocol_serde::shape_malformed_range_override::ser_malformed_range_override_http_error(&self) {
 1823   1858   
            Ok(mut response) => {
 1824   1859   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 1825   1860   
                response
 1826   1861   
            },
 1827   1862   
            Err(e) => {
 1828   1863   
                ::tracing::error!(error = %e, "failed to serialize response");
 1829   1864   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 1830   1865   
            }
 1831   1866   
        }
 1832   1867   
    }
 1833   1868   
}
 1834   1869   
        1870  +
/* RustType.kt:516 */
 1835   1871   
#[allow(unreachable_code, unused_variables)]
        1872  +
/* RustType.kt:516 */
 1836   1873   
#[cfg(test)]
        1874  +
/* ProtocolTestGenerator.kt:98 */
 1837   1875   
mod malformed_range_override_test {
 1838   1876   
 1839   1877   
    /// When a byte member does not fit within range bounds,
 1840   1878   
    /// the response should be a 400 ValidationException.
 1841   1879   
    /// Test ID: RestJsonMalformedRangeByteOverride_case0
 1842   1880   
    #[::tokio::test]
 1843   1881   
    #[::tracing_test::traced_test]
 1844   1882   
    async fn rest_json_malformed_range_byte_override_case0_malformed_request() {
 1845   1883   
        {
 1846   1884   
            #[allow(unused_mut)]
@@ -2872,2910 +2933,2974 @@
 2892   2930   
                expected_headers,
 2893   2931   
            ));
 2894   2932   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 2895   2933   
                .await
 2896   2934   
                .expect("unable to extract body to bytes");
 2897   2935   
            ::aws_smithy_protocol_test::assert_ok(
 2898   2936   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 6\",\n  \"fieldList\" : [{\"message\": \"Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 6\", \"path\": \"/maxLong\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 2899   2937   
            );
 2900   2938   
        }
 2901   2939   
    }
        2940  +
        2941  +
    /* ProtocolTestGenerator.kt:98 */
 2902   2942   
}
 2903   2943   
        2944  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 2904   2945   
const CONTENT_TYPE_MALFORMEDRANGE: ::mime::Mime = ::mime::APPLICATION_JSON;
 2905   2946   
::pin_project_lite::pin_project! {
 2906   2947   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 2907   2948   
    /// [`MalformedRangeInput`](crate::input::MalformedRangeInput) using modelled bindings.
 2908   2949   
    pub struct MalformedRangeInputFuture {
 2909   2950   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedRangeInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 2910   2951   
    }
 2911   2952   
}
 2912   2953   
 2913   2954   
impl std::future::Future for MalformedRangeInputFuture {
@@ -2940,2981 +3038,3084 @@
 2960   3001   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 2961   3002   
                    e,
 2962   3003   
                )
 2963   3004   
            },
 2964   3005   
        );
 2965   3006   
        MalformedRangeInputFuture {
 2966   3007   
            inner: Box::pin(fut),
 2967   3008   
        }
 2968   3009   
    }
 2969   3010   
}
        3011  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 2970   3012   
impl
 2971   3013   
    ::aws_smithy_http_server::response::IntoResponse<
 2972   3014   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 2973   3015   
    > for crate::output::MalformedRangeOutput
 2974   3016   
{
 2975   3017   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2976   3018   
        match crate::protocol_serde::shape_malformed_range::ser_malformed_range_http_response(self)
 2977   3019   
        {
 2978   3020   
            Ok(response) => response,
 2979   3021   
            Err(e) => {
 2980   3022   
                ::tracing::error!(error = %e, "failed to serialize response");
 2981   3023   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 2982   3024   
            }
 2983   3025   
        }
 2984   3026   
    }
 2985   3027   
}
        3028  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 2986   3029   
impl
 2987   3030   
    ::aws_smithy_http_server::response::IntoResponse<
 2988   3031   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 2989   3032   
    > for crate::error::MalformedRangeError
 2990   3033   
{
 2991   3034   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 2992   3035   
        match crate::protocol_serde::shape_malformed_range::ser_malformed_range_http_error(&self) {
 2993   3036   
            Ok(mut response) => {
 2994   3037   
                response.extensions_mut().insert(
 2995   3038   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 2996   3039   
                );
 2997   3040   
                response
 2998   3041   
            }
 2999   3042   
            Err(e) => {
 3000   3043   
                ::tracing::error!(error = %e, "failed to serialize response");
 3001   3044   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 3002   3045   
            }
 3003   3046   
        }
 3004   3047   
    }
 3005   3048   
}
 3006   3049   
        3050  +
/* RustType.kt:516 */
 3007   3051   
#[allow(unreachable_code, unused_variables)]
        3052  +
/* RustType.kt:516 */
 3008   3053   
#[cfg(test)]
        3054  +
/* ProtocolTestGenerator.kt:98 */
 3009   3055   
mod malformed_range_test {
 3010   3056   
 3011   3057   
    /// When a byte member does not fit within range bounds,
 3012   3058   
    /// the response should be a 400 ValidationException.
 3013   3059   
    /// Test ID: RestJsonMalformedRangeByte_case0
 3014   3060   
    #[::tokio::test]
 3015   3061   
    #[::tracing_test::traced_test]
 3016   3062   
    async fn rest_json_malformed_range_byte_case0_malformed_request() {
 3017   3063   
        {
 3018   3064   
            #[allow(unused_mut)]
@@ -4044,4090 +4105,4154 @@
 4064   4110   
                expected_headers,
 4065   4111   
            ));
 4066   4112   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 4067   4113   
                .await
 4068   4114   
                .expect("unable to extract body to bytes");
 4069   4115   
            ::aws_smithy_protocol_test::assert_ok(
 4070   4116   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 8\",\n  \"fieldList\" : [{\"message\": \"Value at '/maxLong' failed to satisfy constraint: Member must be less than or equal to 8\", \"path\": \"/maxLong\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 4071   4117   
            );
 4072   4118   
        }
 4073   4119   
    }
        4120  +
        4121  +
    /* ProtocolTestGenerator.kt:98 */
 4074   4122   
}
 4075   4123   
        4124  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 4076   4125   
const CONTENT_TYPE_MALFORMEDPATTERNOVERRIDE: ::mime::Mime = ::mime::APPLICATION_JSON;
 4077   4126   
::pin_project_lite::pin_project! {
 4078   4127   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 4079   4128   
    /// [`MalformedPatternOverrideInput`](crate::input::MalformedPatternOverrideInput) using modelled bindings.
 4080   4129   
    pub struct MalformedPatternOverrideInputFuture {
 4081   4130   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedPatternOverrideInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 4082   4131   
    }
 4083   4132   
}
 4084   4133   
 4085   4134   
impl std::future::Future for MalformedPatternOverrideInputFuture {
@@ -4112,4161 +4207,4261 @@
 4132   4181   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 4133   4182   
                    e,
 4134   4183   
                )
 4135   4184   
            },
 4136   4185   
        );
 4137   4186   
        MalformedPatternOverrideInputFuture {
 4138   4187   
            inner: Box::pin(fut),
 4139   4188   
        }
 4140   4189   
    }
 4141   4190   
}
        4191  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 4142   4192   
impl
 4143   4193   
    ::aws_smithy_http_server::response::IntoResponse<
 4144   4194   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 4145   4195   
    > for crate::output::MalformedPatternOverrideOutput
 4146   4196   
{
 4147   4197   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 4148   4198   
        match crate::protocol_serde::shape_malformed_pattern_override::ser_malformed_pattern_override_http_response(self) {
 4149   4199   
                        Ok(response) => response,
 4150   4200   
                        Err(e) => {
 4151   4201   
                            ::tracing::error!(error = %e, "failed to serialize response");
 4152   4202   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 4153   4203   
                        }
 4154   4204   
                    }
 4155   4205   
    }
 4156   4206   
}
        4207  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 4157   4208   
impl
 4158   4209   
    ::aws_smithy_http_server::response::IntoResponse<
 4159   4210   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 4160   4211   
    > for crate::error::MalformedPatternOverrideError
 4161   4212   
{
 4162   4213   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 4163   4214   
        match crate::protocol_serde::shape_malformed_pattern_override::ser_malformed_pattern_override_http_error(&self) {
 4164   4215   
            Ok(mut response) => {
 4165   4216   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 4166   4217   
                response
 4167   4218   
            },
 4168   4219   
            Err(e) => {
 4169   4220   
                ::tracing::error!(error = %e, "failed to serialize response");
 4170   4221   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 4171   4222   
            }
 4172   4223   
        }
 4173   4224   
    }
 4174   4225   
}
 4175   4226   
        4227  +
/* RustType.kt:516 */
 4176   4228   
#[allow(unreachable_code, unused_variables)]
        4229  +
/* RustType.kt:516 */
 4177   4230   
#[cfg(test)]
        4231  +
/* ProtocolTestGenerator.kt:98 */
 4178   4232   
mod malformed_pattern_override_test {
 4179   4233   
 4180   4234   
    /// When a string member does not match the specified pattern,
 4181   4235   
    /// the response should be a 400 ValidationException.
 4182   4236   
    /// Test ID: RestJsonMalformedPatternStringOverride_case0
 4183   4237   
    #[::tokio::test]
 4184   4238   
    #[::tracing_test::traced_test]
 4185   4239   
    async fn rest_json_malformed_pattern_string_override_case0_malformed_request() {
 4186   4240   
        {
 4187   4241   
            #[allow(unused_mut)]
@@ -4679,4733 +4740,4797 @@
 4699   4753   
                expected_headers,
 4700   4754   
            ));
 4701   4755   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 4702   4756   
                .await
 4703   4757   
                .expect("unable to extract body to bytes");
 4704   4758   
            ::aws_smithy_protocol_test::assert_ok(
 4705   4759   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\",\n  \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[g-m]+$\", \"path\": \"/union/first\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 4706   4760   
            );
 4707   4761   
        }
 4708   4762   
    }
        4763  +
        4764  +
    /* ProtocolTestGenerator.kt:98 */
 4709   4765   
}
 4710   4766   
        4767  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 4711   4768   
const CONTENT_TYPE_MALFORMEDPATTERN: ::mime::Mime = ::mime::APPLICATION_JSON;
 4712   4769   
::pin_project_lite::pin_project! {
 4713   4770   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 4714   4771   
    /// [`MalformedPatternInput`](crate::input::MalformedPatternInput) using modelled bindings.
 4715   4772   
    pub struct MalformedPatternInputFuture {
 4716   4773   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedPatternInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 4717   4774   
    }
 4718   4775   
}
 4719   4776   
 4720   4777   
impl std::future::Future for MalformedPatternInputFuture {
@@ -4749,4806 +4850,4912 @@
 4769   4826   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 4770   4827   
                    e,
 4771   4828   
                )
 4772   4829   
            },
 4773   4830   
        );
 4774   4831   
        MalformedPatternInputFuture {
 4775   4832   
            inner: Box::pin(fut),
 4776   4833   
        }
 4777   4834   
    }
 4778   4835   
}
        4836  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 4779   4837   
impl
 4780   4838   
    ::aws_smithy_http_server::response::IntoResponse<
 4781   4839   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 4782   4840   
    > for crate::output::MalformedPatternOutput
 4783   4841   
{
 4784   4842   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 4785   4843   
        match crate::protocol_serde::shape_malformed_pattern::ser_malformed_pattern_http_response(
 4786   4844   
            self,
 4787   4845   
        ) {
 4788   4846   
            Ok(response) => response,
 4789   4847   
            Err(e) => {
 4790   4848   
                ::tracing::error!(error = %e, "failed to serialize response");
 4791   4849   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 4792   4850   
            }
 4793   4851   
        }
 4794   4852   
    }
 4795   4853   
}
        4854  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 4796   4855   
impl
 4797   4856   
    ::aws_smithy_http_server::response::IntoResponse<
 4798   4857   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 4799   4858   
    > for crate::error::MalformedPatternError
 4800   4859   
{
 4801   4860   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 4802   4861   
        match crate::protocol_serde::shape_malformed_pattern::ser_malformed_pattern_http_error(
 4803   4862   
            &self,
 4804   4863   
        ) {
 4805   4864   
            Ok(mut response) => {
 4806   4865   
                response.extensions_mut().insert(
 4807   4866   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 4808   4867   
                );
 4809   4868   
                response
 4810   4869   
            }
 4811   4870   
            Err(e) => {
 4812   4871   
                ::tracing::error!(error = %e, "failed to serialize response");
 4813   4872   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 4814   4873   
            }
 4815   4874   
        }
 4816   4875   
    }
 4817   4876   
}
 4818   4877   
        4878  +
/* RustType.kt:516 */
 4819   4879   
#[allow(unreachable_code, unused_variables)]
        4880  +
/* RustType.kt:516 */
 4820   4881   
#[cfg(test)]
        4882  +
/* ProtocolTestGenerator.kt:98 */
 4821   4883   
mod malformed_pattern_test {
 4822   4884   
 4823   4885   
    /// When a string member does not match the specified pattern,
 4824   4886   
    /// the response should be a 400 ValidationException.
 4825   4887   
    /// Test ID: RestJsonMalformedPatternString_case0
 4826   4888   
    #[::tokio::test]
 4827   4889   
    #[::tracing_test::traced_test]
 4828   4890   
    async fn rest_json_malformed_pattern_string_case0_malformed_request() {
 4829   4891   
        {
 4830   4892   
            #[allow(unused_mut)]
@@ -5425,5487 +5486,5551 @@
 5445   5507   
                expected_headers,
 5446   5508   
            ));
 5447   5509   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 5448   5510   
                .await
 5449   5511   
                .expect("unable to extract body to bytes");
 5450   5512   
            ::aws_smithy_protocol_test::assert_ok(
 5451   5513   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\",\n  \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-m]+$\", \"path\": \"/union/first\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 5452   5514   
            );
 5453   5515   
        }
 5454   5516   
    }
        5517  +
        5518  +
    /* ProtocolTestGenerator.kt:98 */
 5455   5519   
}
 5456   5520   
        5521  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 5457   5522   
const CONTENT_TYPE_MALFORMEDLENGTHQUERYSTRING: ::mime::Mime = ::mime::APPLICATION_JSON;
 5458   5523   
::pin_project_lite::pin_project! {
 5459   5524   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 5460   5525   
    /// [`MalformedLengthQueryStringInput`](crate::input::MalformedLengthQueryStringInput) using modelled bindings.
 5461   5526   
    pub struct MalformedLengthQueryStringInputFuture {
 5462   5527   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedLengthQueryStringInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 5463   5528   
    }
 5464   5529   
}
 5465   5530   
 5466   5531   
impl std::future::Future for MalformedLengthQueryStringInputFuture {
@@ -5493,5558 +5645,5718 @@
 5513   5578   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 5514   5579   
                    e,
 5515   5580   
                )
 5516   5581   
            },
 5517   5582   
        );
 5518   5583   
        MalformedLengthQueryStringInputFuture {
 5519   5584   
            inner: Box::pin(fut),
 5520   5585   
        }
 5521   5586   
    }
 5522   5587   
}
        5588  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 5523   5589   
impl
 5524   5590   
    ::aws_smithy_http_server::response::IntoResponse<
 5525   5591   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 5526   5592   
    > for crate::output::MalformedLengthQueryStringOutput
 5527   5593   
{
 5528   5594   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 5529   5595   
        match crate::protocol_serde::shape_malformed_length_query_string::ser_malformed_length_query_string_http_response(self) {
 5530   5596   
                        Ok(response) => response,
 5531   5597   
                        Err(e) => {
 5532   5598   
                            ::tracing::error!(error = %e, "failed to serialize response");
 5533   5599   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 5534   5600   
                        }
 5535   5601   
                    }
 5536   5602   
    }
 5537   5603   
}
        5604  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 5538   5605   
impl
 5539   5606   
    ::aws_smithy_http_server::response::IntoResponse<
 5540   5607   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 5541   5608   
    > for crate::error::MalformedLengthQueryStringError
 5542   5609   
{
 5543   5610   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 5544   5611   
        match crate::protocol_serde::shape_malformed_length_query_string::ser_malformed_length_query_string_http_error(&self) {
 5545   5612   
            Ok(mut response) => {
 5546   5613   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 5547   5614   
                response
 5548   5615   
            },
 5549   5616   
            Err(e) => {
 5550   5617   
                ::tracing::error!(error = %e, "failed to serialize response");
 5551   5618   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 5552   5619   
            }
 5553   5620   
        }
 5554   5621   
    }
 5555   5622   
}
 5556   5623   
        5624  +
/* RustType.kt:516 */
 5557   5625   
#[allow(unreachable_code, unused_variables)]
        5626  +
/* RustType.kt:516 */
 5558   5627   
#[cfg(test)]
        5628  +
/* ProtocolTestGenerator.kt:98 */
 5559   5629   
mod malformed_length_query_string_test {
 5560   5630   
 5561   5631   
    /// When a required member has no value in the query string,
 5562   5632   
    /// the response should be a 400 ValidationException.
 5563   5633   
    /// Test ID: RestJsonMalformedLengthQueryStringNoValue
 5564   5634   
    #[::tokio::test]
 5565   5635   
    #[::tracing_test::traced_test]
 5566   5636   
    async fn rest_json_malformed_length_query_string_no_value_malformed_request() {
 5567   5637   
        {
 5568   5638   
            #[allow(unused_mut)]
 5569   5639   
            let mut http_request = http::Request::builder()
 5570   5640   
                .uri("/MalformedLengthQueryString")
 5571   5641   
                .method("POST")
 5572   5642   
                .header("content-type", "application/json")
 5573   5643   
                .body(::aws_smithy_http_server::body::Body::from(
 5574   5644   
                    ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
 5575   5645   
                        "{}".as_bytes(),
 5576   5646   
                        ::aws_smithy_protocol_test::MediaType::from("unknown"),
 5577   5647   
                    )),
 5578   5648   
                ))
 5579   5649   
                .unwrap();
 5580   5650   
            *http_request.uri_mut() = "/MalformedLengthQueryString?string".parse().unwrap();
 5581   5651   
            #[allow(unused_mut)]
 5582   5652   
            let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
 5583   5653   
            let config = crate::service::RestJsonValidationConfig::builder().build();
 5584   5654   
            let service = crate::service::RestJsonValidation::builder::<::hyper::body::Body, _, _, _>(config)
 5585   5655   
                            .malformed_length_query_string(move |input: crate::input::MalformedLengthQueryStringInput| {
 5586   5656   
                                let sender = sender.clone();
 5587   5657   
                                async move {
 5588   5658   
                                    let result = { panic!("request should have been rejected, but we accepted it; we parsed operation input `{:?}`", &input) as Result<crate::output::MalformedLengthQueryStringOutput, crate::error::MalformedLengthQueryStringError> };
 5589   5659   
                                    sender.send(()).await.expect("receiver dropped early");
 5590   5660   
                                    result
 5591   5661   
                                }
 5592   5662   
                            })
 5593   5663   
                            .build_unchecked();
 5594   5664   
            let http_response = ::tower::ServiceExt::oneshot(service, http_request)
 5595   5665   
                .await
 5596   5666   
                .expect("unable to make an HTTP request");
 5597   5667   
            ::pretty_assertions::assert_eq!(
 5598   5668   
                http::StatusCode::from_u16(400).expect("invalid expected HTTP status code"),
 5599   5669   
                http_response.status()
 5600   5670   
            );
 5601   5671   
            let expected_headers = [("x-amzn-errortype", "ValidationException")];
 5602   5672   
            ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(
 5603   5673   
                http_response.headers(),
 5604   5674   
                expected_headers,
 5605   5675   
            ));
 5606   5676   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 5607   5677   
                .await
 5608   5678   
                .expect("unable to extract body to bytes");
 5609   5679   
            ::aws_smithy_protocol_test::assert_ok(
 5610   5680   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value with length 0 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\",\n  \"fieldList\" : [{\"message\": \"Value with length 0 at '/string' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/string\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 5611   5681   
            );
 5612   5682   
        }
 5613   5683   
    }
        5684  +
        5685  +
    /* ProtocolTestGenerator.kt:98 */
 5614   5686   
}
 5615   5687   
        5688  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 5616   5689   
const CONTENT_TYPE_MALFORMEDLENGTHOVERRIDE: ::mime::Mime = ::mime::APPLICATION_JSON;
 5617   5690   
::pin_project_lite::pin_project! {
 5618   5691   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 5619   5692   
    /// [`MalformedLengthOverrideInput`](crate::input::MalformedLengthOverrideInput) using modelled bindings.
 5620   5693   
    pub struct MalformedLengthOverrideInputFuture {
 5621   5694   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedLengthOverrideInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 5622   5695   
    }
 5623   5696   
}
 5624   5697   
 5625   5698   
impl std::future::Future for MalformedLengthOverrideInputFuture {
@@ -5652,5725 +5747,5825 @@
 5672   5745   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 5673   5746   
                    e,
 5674   5747   
                )
 5675   5748   
            },
 5676   5749   
        );
 5677   5750   
        MalformedLengthOverrideInputFuture {
 5678   5751   
            inner: Box::pin(fut),
 5679   5752   
        }
 5680   5753   
    }
 5681   5754   
}
        5755  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 5682   5756   
impl
 5683   5757   
    ::aws_smithy_http_server::response::IntoResponse<
 5684   5758   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 5685   5759   
    > for crate::output::MalformedLengthOverrideOutput
 5686   5760   
{
 5687   5761   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 5688   5762   
        match crate::protocol_serde::shape_malformed_length_override::ser_malformed_length_override_http_response(self) {
 5689   5763   
                        Ok(response) => response,
 5690   5764   
                        Err(e) => {
 5691   5765   
                            ::tracing::error!(error = %e, "failed to serialize response");
 5692   5766   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 5693   5767   
                        }
 5694   5768   
                    }
 5695   5769   
    }
 5696   5770   
}
        5771  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 5697   5772   
impl
 5698   5773   
    ::aws_smithy_http_server::response::IntoResponse<
 5699   5774   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 5700   5775   
    > for crate::error::MalformedLengthOverrideError
 5701   5776   
{
 5702   5777   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 5703   5778   
        match crate::protocol_serde::shape_malformed_length_override::ser_malformed_length_override_http_error(&self) {
 5704   5779   
            Ok(mut response) => {
 5705   5780   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
 5706   5781   
                response
 5707   5782   
            },
 5708   5783   
            Err(e) => {
 5709   5784   
                ::tracing::error!(error = %e, "failed to serialize response");
 5710   5785   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 5711   5786   
            }
 5712   5787   
        }
 5713   5788   
    }
 5714   5789   
}
 5715   5790   
        5791  +
/* RustType.kt:516 */
 5716   5792   
#[allow(unreachable_code, unused_variables)]
        5793  +
/* RustType.kt:516 */
 5717   5794   
#[cfg(test)]
        5795  +
/* ProtocolTestGenerator.kt:98 */
 5718   5796   
mod malformed_length_override_test {
 5719   5797   
 5720   5798   
    /// When a blob member does not fit within length bounds,
 5721   5799   
    /// the response should be a 400 ValidationException.
 5722   5800   
    /// Test ID: RestJsonMalformedLengthBlobOverride_case0
 5723   5801   
    #[::tokio::test]
 5724   5802   
    #[::tracing_test::traced_test]
 5725   5803   
    async fn rest_json_malformed_length_blob_override_case0_malformed_request() {
 5726   5804   
        {
 5727   5805   
            #[allow(unused_mut)]
@@ -6266,6344 +6327,6408 @@
 6286   6364   
                expected_headers,
 6287   6365   
            ));
 6288   6366   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 6289   6367   
                .await
 6290   6368   
                .expect("unable to extract body to bytes");
 6291   6369   
            ::aws_smithy_protocol_test::assert_ok(
 6292   6370   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value with length 7 at '/map' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\",\n  \"fieldList\" : [{\"message\": \"Value with length 7 at '/map' failed to satisfy constraint: Member must have length between 4 and 6, inclusive\", \"path\": \"/map\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 6293   6371   
            );
 6294   6372   
        }
 6295   6373   
    }
        6374  +
        6375  +
    /* ProtocolTestGenerator.kt:98 */
 6296   6376   
}
 6297   6377   
        6378  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 6298   6379   
const CONTENT_TYPE_MALFORMEDLENGTH: ::mime::Mime = ::mime::APPLICATION_JSON;
 6299   6380   
::pin_project_lite::pin_project! {
 6300   6381   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 6301   6382   
    /// [`MalformedLengthInput`](crate::input::MalformedLengthInput) using modelled bindings.
 6302   6383   
    pub struct MalformedLengthInputFuture {
 6303   6384   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedLengthInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 6304   6385   
    }
 6305   6386   
}
 6306   6387   
 6307   6388   
impl std::future::Future for MalformedLengthInputFuture {
@@ -6334,6415 +6434,6520 @@
 6354   6435   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 6355   6436   
                    e,
 6356   6437   
                )
 6357   6438   
            },
 6358   6439   
        );
 6359   6440   
        MalformedLengthInputFuture {
 6360   6441   
            inner: Box::pin(fut),
 6361   6442   
        }
 6362   6443   
    }
 6363   6444   
}
        6445  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 6364   6446   
impl
 6365   6447   
    ::aws_smithy_http_server::response::IntoResponse<
 6366   6448   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 6367   6449   
    > for crate::output::MalformedLengthOutput
 6368   6450   
{
 6369   6451   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 6370   6452   
        match crate::protocol_serde::shape_malformed_length::ser_malformed_length_http_response(
 6371   6453   
            self,
 6372   6454   
        ) {
 6373   6455   
            Ok(response) => response,
 6374   6456   
            Err(e) => {
 6375   6457   
                ::tracing::error!(error = %e, "failed to serialize response");
 6376   6458   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 6377   6459   
            }
 6378   6460   
        }
 6379   6461   
    }
 6380   6462   
}
        6463  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 6381   6464   
impl
 6382   6465   
    ::aws_smithy_http_server::response::IntoResponse<
 6383   6466   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 6384   6467   
    > for crate::error::MalformedLengthError
 6385   6468   
{
 6386   6469   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 6387   6470   
        match crate::protocol_serde::shape_malformed_length::ser_malformed_length_http_error(&self)
 6388   6471   
        {
 6389   6472   
            Ok(mut response) => {
 6390   6473   
                response.extensions_mut().insert(
 6391   6474   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 6392   6475   
                );
 6393   6476   
                response
 6394   6477   
            }
 6395   6478   
            Err(e) => {
 6396   6479   
                ::tracing::error!(error = %e, "failed to serialize response");
 6397   6480   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 6398   6481   
            }
 6399   6482   
        }
 6400   6483   
    }
 6401   6484   
}
 6402   6485   
        6486  +
/* RustType.kt:516 */
 6403   6487   
#[allow(unreachable_code, unused_variables)]
        6488  +
/* RustType.kt:516 */
 6404   6489   
#[cfg(test)]
        6490  +
/* ProtocolTestGenerator.kt:98 */
 6405   6491   
mod malformed_length_test {
 6406   6492   
 6407   6493   
    /// When a blob member does not fit within length bounds,
 6408   6494   
    /// the response should be a 400 ValidationException.
 6409   6495   
    /// Test ID: RestJsonMalformedLengthBlob_case0
 6410   6496   
    #[::tokio::test]
 6411   6497   
    #[::tracing_test::traced_test]
 6412   6498   
    async fn rest_json_malformed_length_blob_case0_malformed_request() {
 6413   6499   
        {
 6414   6500   
            #[allow(unused_mut)]
@@ -7265,7351 +7326,7415 @@
 7285   7371   
                expected_headers,
 7286   7372   
            ));
 7287   7373   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 7288   7374   
                .await
 7289   7375   
                .expect("unable to extract body to bytes");
 7290   7376   
            ::aws_smithy_protocol_test::assert_ok(
 7291   7377   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value with length 10 at '/map/abc' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\",\n  \"fieldList\" : [{\"message\": \"Value with length 10 at '/map/abc' failed to satisfy constraint: Member must have length between 2 and 8, inclusive\", \"path\": \"/map/abc\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 7292   7378   
            );
 7293   7379   
        }
 7294   7380   
    }
        7381  +
        7382  +
    /* ProtocolTestGenerator.kt:98 */
 7295   7383   
}
 7296   7384   
        7385  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
 7297   7386   
const CONTENT_TYPE_MALFORMEDENUM: ::mime::Mime = ::mime::APPLICATION_JSON;
 7298   7387   
::pin_project_lite::pin_project! {
 7299   7388   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
 7300   7389   
    /// [`MalformedEnumInput`](crate::input::MalformedEnumInput) using modelled bindings.
 7301   7390   
    pub struct MalformedEnumInputFuture {
 7302   7391   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MalformedEnumInput, ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError>> + Send>>
 7303   7392   
    }
 7304   7393   
}
 7305   7394   
 7306   7395   
impl std::future::Future for MalformedEnumInputFuture {
@@ -7333,7422 +7430,7524 @@
 7353   7442   
                ::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(
 7354   7443   
                    e,
 7355   7444   
                )
 7356   7445   
            },
 7357   7446   
        );
 7358   7447   
        MalformedEnumInputFuture {
 7359   7448   
            inner: Box::pin(fut),
 7360   7449   
        }
 7361   7450   
    }
 7362   7451   
}
        7452  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
 7363   7453   
impl
 7364   7454   
    ::aws_smithy_http_server::response::IntoResponse<
 7365   7455   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 7366   7456   
    > for crate::output::MalformedEnumOutput
 7367   7457   
{
 7368   7458   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 7369   7459   
        match crate::protocol_serde::shape_malformed_enum::ser_malformed_enum_http_response(self) {
 7370   7460   
            Ok(response) => response,
 7371   7461   
            Err(e) => {
 7372   7462   
                ::tracing::error!(error = %e, "failed to serialize response");
 7373   7463   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 7374   7464   
            }
 7375   7465   
        }
 7376   7466   
    }
 7377   7467   
}
        7468  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
 7378   7469   
impl
 7379   7470   
    ::aws_smithy_http_server::response::IntoResponse<
 7380   7471   
        ::aws_smithy_http_server::protocol::rest_json_1::RestJson1,
 7381   7472   
    > for crate::error::MalformedEnumError
 7382   7473   
{
 7383   7474   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
 7384   7475   
        match crate::protocol_serde::shape_malformed_enum::ser_malformed_enum_http_error(&self) {
 7385   7476   
            Ok(mut response) => {
 7386   7477   
                response.extensions_mut().insert(
 7387   7478   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
 7388   7479   
                );
 7389   7480   
                response
 7390   7481   
            }
 7391   7482   
            Err(e) => {
 7392   7483   
                ::tracing::error!(error = %e, "failed to serialize response");
 7393   7484   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::rest_json_1::RestJson1>::into_response(::aws_smithy_http_server::protocol::rest_json_1::runtime_error::RuntimeError::from(e))
 7394   7485   
            }
 7395   7486   
        }
 7396   7487   
    }
 7397   7488   
}
 7398   7489   
        7490  +
/* RustType.kt:516 */
 7399   7491   
#[allow(unreachable_code, unused_variables)]
        7492  +
/* RustType.kt:516 */
 7400   7493   
#[cfg(test)]
        7494  +
/* ProtocolTestGenerator.kt:98 */
 7401   7495   
mod malformed_enum_test {
 7402   7496   
 7403   7497   
    /// When a string member does not contain a valid enum value,
 7404   7498   
    /// the response should be a 400 ValidationException. Internal-only
 7405   7499   
    /// enum values are excluded from the response message.
 7406   7500   
    /// Test ID: RestJsonMalformedEnumString_case0
 7407   7501   
    #[::tokio::test]
 7408   7502   
    #[::tracing_test::traced_test]
 7409   7503   
    #[should_panic]
 7410   7504   
    async fn rest_json_malformed_enum_string_case0_malformed_request() {
@@ -8032,8126 +8062,8158 @@
 8052   8146   
                expected_headers,
 8053   8147   
            ));
 8054   8148   
            let body = ::hyper::body::to_bytes(http_response.into_body())
 8055   8149   
                .await
 8056   8150   
                .expect("unable to extract body to bytes");
 8057   8151   
            ::aws_smithy_protocol_test::assert_ok(
 8058   8152   
            ::aws_smithy_protocol_test::validate_body(&body, "{ \"message\" : \"1 validation error detected. Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\",\n  \"fieldList\" : [{\"message\": \"Value at '/union/first' failed to satisfy constraint: Member must satisfy enum value set: [abc, def, jkl]\", \"path\": \"/union/first\"}]}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
 8059   8153   
            );
 8060   8154   
        }
 8061   8155   
    }
        8156  +
        8157  +
    /* ProtocolTestGenerator.kt:98 */
 8062   8158   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/operation_shape.rs

@@ -1,1 +0,500 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* ServerOperationGenerator.kt:48 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
                       /* ServerOperationGenerator.kt:55 */
    3      5   
pub struct SensitiveValidation;
    4      6   
    5      7   
impl ::aws_smithy_http_server::operation::OperationShape for SensitiveValidation {
    6      8   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7      9   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
    8     10   
            "aws.protocoltests.restjson.validation#SensitiveValidation",
    9     11   
            "aws.protocoltests.restjson.validation",
   10     12   
            "SensitiveValidation",
   11     13   
        );
   12     14   
   13     15   
    type Input = crate::input::SensitiveValidationInput;
   14     16   
    type Output = crate::output::SensitiveValidationOutput;
   15     17   
    type Error = crate::error::SensitiveValidationError;
   16     18   
}
   17     19   
   18     20   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for SensitiveValidation {
   19     21   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   20     22   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   21     23   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   22     24   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   23     25   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   24     26   
        >,
   25     27   
    >;
   26     28   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   27     29   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   28     30   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   29     31   
    >;
   30     32   
   31     33   
    fn request_fmt() -> Self::RequestFmt {
   32     34   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   33     35   
    }
   34     36   
   35     37   
    fn response_fmt() -> Self::ResponseFmt {
   36     38   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   37     39   
    }
   38     40   
}
          41  +
/* ServerOperationGenerator.kt:88 */
   39     42   
          43  +
/* ServerOperationGenerator.kt:48 */
   40     44   
#[allow(missing_docs)] // documentation missing in model
          45  +
                       /* ServerOperationGenerator.kt:55 */
   41     46   
pub struct RecursiveStructures;
   42     47   
   43     48   
impl ::aws_smithy_http_server::operation::OperationShape for RecursiveStructures {
   44     49   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   45     50   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   46     51   
            "aws.protocoltests.restjson.validation#RecursiveStructures",
   47     52   
            "aws.protocoltests.restjson.validation",
   48     53   
            "RecursiveStructures",
   49     54   
        );
   50     55   
   51     56   
    type Input = crate::input::RecursiveStructuresInput;
   52     57   
    type Output = crate::output::RecursiveStructuresOutput;
   53     58   
    type Error = crate::error::RecursiveStructuresError;
   54     59   
}
   55     60   
   56     61   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for RecursiveStructures {
   57     62   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   58     63   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   59     64   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   60     65   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   61     66   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   62     67   
        >,
   63     68   
    >;
   64     69   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
   65     70   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   66     71   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   67     72   
    >;
   68     73   
   69     74   
    fn request_fmt() -> Self::RequestFmt {
   70     75   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   71     76   
    }
   72     77   
   73     78   
    fn response_fmt() -> Self::ResponseFmt {
   74     79   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   75     80   
    }
   76     81   
}
          82  +
/* ServerOperationGenerator.kt:88 */
   77     83   
          84  +
/* ServerOperationGenerator.kt:48 */
   78     85   
#[allow(missing_docs)] // documentation missing in model
          86  +
                       /* ServerOperationGenerator.kt:55 */
   79     87   
pub struct MalformedUniqueItems;
   80     88   
   81     89   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedUniqueItems {
   82     90   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   83     91   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
   84     92   
            "aws.protocoltests.restjson.validation#MalformedUniqueItems",
   85     93   
            "aws.protocoltests.restjson.validation",
   86     94   
            "MalformedUniqueItems",
   87     95   
        );
   88     96   
   89     97   
    type Input = crate::input::MalformedUniqueItemsInput;
   90     98   
    type Output = crate::output::MalformedUniqueItemsOutput;
   91     99   
    type Error = crate::error::MalformedUniqueItemsError;
   92    100   
}
   93    101   
   94    102   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for MalformedUniqueItems {
   95    103   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
   96    104   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
   97    105   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
   98    106   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
   99    107   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  100    108   
        >,
  101    109   
    >;
  102    110   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  103    111   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  104    112   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  105    113   
    >;
  106    114   
  107    115   
    fn request_fmt() -> Self::RequestFmt {
  108    116   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  109    117   
    }
  110    118   
  111    119   
    fn response_fmt() -> Self::ResponseFmt {
  112    120   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  113    121   
    }
  114    122   
}
         123  +
/* ServerOperationGenerator.kt:88 */
  115    124   
         125  +
/* ServerOperationGenerator.kt:48 */
  116    126   
#[allow(missing_docs)] // documentation missing in model
         127  +
                       /* ServerOperationGenerator.kt:55 */
  117    128   
pub struct MalformedRequired;
  118    129   
  119    130   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedRequired {
  120    131   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  121    132   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  122    133   
            "aws.protocoltests.restjson.validation#MalformedRequired",
  123    134   
            "aws.protocoltests.restjson.validation",
  124    135   
            "MalformedRequired",
  125    136   
        );
  126    137   
  127    138   
    type Input = crate::input::MalformedRequiredInput;
  128    139   
    type Output = crate::output::MalformedRequiredOutput;
  129    140   
    type Error = crate::error::MalformedRequiredError;
  130    141   
}
  131    142   
  132    143   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for MalformedRequired {
  133    144   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  134    145   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  135    146   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  136    147   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  137    148   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  138    149   
        >,
  139    150   
    >;
  140    151   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  141    152   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  142    153   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  143    154   
    >;
  144    155   
  145    156   
    fn request_fmt() -> Self::RequestFmt {
  146    157   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  147    158   
    }
  148    159   
  149    160   
    fn response_fmt() -> Self::ResponseFmt {
  150    161   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  151    162   
    }
  152    163   
}
         164  +
/* ServerOperationGenerator.kt:88 */
  153    165   
         166  +
/* ServerOperationGenerator.kt:48 */
  154    167   
#[allow(missing_docs)] // documentation missing in model
         168  +
                       /* ServerOperationGenerator.kt:55 */
  155    169   
pub struct MalformedRangeOverride;
  156    170   
  157    171   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedRangeOverride {
  158    172   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  159    173   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  160    174   
            "aws.protocoltests.restjson.validation#MalformedRangeOverride",
  161    175   
            "aws.protocoltests.restjson.validation",
  162    176   
            "MalformedRangeOverride",
  163    177   
        );
  164    178   
  165    179   
    type Input = crate::input::MalformedRangeOverrideInput;
  166    180   
    type Output = crate::output::MalformedRangeOverrideOutput;
  167    181   
    type Error = crate::error::MalformedRangeOverrideError;
  168    182   
}
  169    183   
  170    184   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
  171    185   
    for MalformedRangeOverride
  172    186   
{
  173    187   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  174    188   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  175    189   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  176    190   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  177    191   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  178    192   
        >,
  179    193   
    >;
  180    194   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  181    195   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  182    196   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  183    197   
    >;
  184    198   
  185    199   
    fn request_fmt() -> Self::RequestFmt {
  186    200   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  187    201   
    }
  188    202   
  189    203   
    fn response_fmt() -> Self::ResponseFmt {
  190    204   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  191    205   
    }
  192    206   
}
         207  +
/* ServerOperationGenerator.kt:88 */
  193    208   
         209  +
/* ServerOperationGenerator.kt:48 */
  194    210   
#[allow(missing_docs)] // documentation missing in model
         211  +
                       /* ServerOperationGenerator.kt:55 */
  195    212   
pub struct MalformedRange;
  196    213   
  197    214   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedRange {
  198    215   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  199    216   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  200    217   
            "aws.protocoltests.restjson.validation#MalformedRange",
  201    218   
            "aws.protocoltests.restjson.validation",
  202    219   
            "MalformedRange",
  203    220   
        );
  204    221   
  205    222   
    type Input = crate::input::MalformedRangeInput;
  206    223   
    type Output = crate::output::MalformedRangeOutput;
  207    224   
    type Error = crate::error::MalformedRangeError;
  208    225   
}
  209    226   
  210    227   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for MalformedRange {
  211    228   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  212    229   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  213    230   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  214    231   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  215    232   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  216    233   
        >,
  217    234   
    >;
  218    235   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  219    236   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  220    237   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  221    238   
    >;
  222    239   
  223    240   
    fn request_fmt() -> Self::RequestFmt {
  224    241   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  225    242   
    }
  226    243   
  227    244   
    fn response_fmt() -> Self::ResponseFmt {
  228    245   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  229    246   
    }
  230    247   
}
         248  +
/* ServerOperationGenerator.kt:88 */
  231    249   
         250  +
/* ServerOperationGenerator.kt:48 */
  232    251   
#[allow(missing_docs)] // documentation missing in model
         252  +
                       /* ServerOperationGenerator.kt:55 */
  233    253   
pub struct MalformedPatternOverride;
  234    254   
  235    255   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedPatternOverride {
  236    256   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  237    257   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  238    258   
            "aws.protocoltests.restjson.validation#MalformedPatternOverride",
  239    259   
            "aws.protocoltests.restjson.validation",
  240    260   
            "MalformedPatternOverride",
  241    261   
        );
  242    262   
  243    263   
    type Input = crate::input::MalformedPatternOverrideInput;
  244    264   
    type Output = crate::output::MalformedPatternOverrideOutput;
  245    265   
    type Error = crate::error::MalformedPatternOverrideError;
  246    266   
}
  247    267   
  248    268   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
  249    269   
    for MalformedPatternOverride
  250    270   
{
  251    271   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  252    272   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  253    273   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  254    274   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  255    275   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  256    276   
        >,
  257    277   
    >;
  258    278   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  259    279   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  260    280   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  261    281   
    >;
  262    282   
  263    283   
    fn request_fmt() -> Self::RequestFmt {
  264    284   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  265    285   
    }
  266    286   
  267    287   
    fn response_fmt() -> Self::ResponseFmt {
  268    288   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  269    289   
    }
  270    290   
}
         291  +
/* ServerOperationGenerator.kt:88 */
  271    292   
         293  +
/* ServerOperationGenerator.kt:48 */
  272    294   
#[allow(missing_docs)] // documentation missing in model
         295  +
                       /* ServerOperationGenerator.kt:55 */
  273    296   
pub struct MalformedPattern;
  274    297   
  275    298   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedPattern {
  276    299   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  277    300   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  278    301   
            "aws.protocoltests.restjson.validation#MalformedPattern",
  279    302   
            "aws.protocoltests.restjson.validation",
  280    303   
            "MalformedPattern",
  281    304   
        );
  282    305   
  283    306   
    type Input = crate::input::MalformedPatternInput;
  284    307   
    type Output = crate::output::MalformedPatternOutput;
  285    308   
    type Error = crate::error::MalformedPatternError;
  286    309   
}
  287    310   
  288    311   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for MalformedPattern {
  289    312   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  290    313   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  291    314   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  292    315   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  293    316   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  294    317   
        >,
  295    318   
    >;
  296    319   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  297    320   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  298    321   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  299    322   
    >;
  300    323   
  301    324   
    fn request_fmt() -> Self::RequestFmt {
  302    325   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  303    326   
    }
  304    327   
  305    328   
    fn response_fmt() -> Self::ResponseFmt {
  306    329   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  307    330   
    }
  308    331   
}
         332  +
/* ServerOperationGenerator.kt:88 */
  309    333   
         334  +
/* ServerOperationGenerator.kt:48 */
  310    335   
#[allow(missing_docs)] // documentation missing in model
         336  +
                       /* ServerOperationGenerator.kt:55 */
  311    337   
pub struct MalformedLengthQueryString;
  312    338   
  313    339   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedLengthQueryString {
  314    340   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  315    341   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  316    342   
            "aws.protocoltests.restjson.validation#MalformedLengthQueryString",
  317    343   
            "aws.protocoltests.restjson.validation",
  318    344   
            "MalformedLengthQueryString",
  319    345   
        );
  320    346   
  321    347   
    type Input = crate::input::MalformedLengthQueryStringInput;
  322    348   
    type Output = crate::output::MalformedLengthQueryStringOutput;
  323    349   
    type Error = crate::error::MalformedLengthQueryStringError;
  324    350   
}
  325    351   
  326    352   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
  327    353   
    for MalformedLengthQueryString
  328    354   
{
  329    355   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  330    356   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  331    357   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  332    358   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  333    359   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  334    360   
        >,
  335    361   
    >;
  336    362   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  337    363   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  338    364   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  339    365   
    >;
  340    366   
  341    367   
    fn request_fmt() -> Self::RequestFmt {
  342    368   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  343    369   
    }
  344    370   
  345    371   
    fn response_fmt() -> Self::ResponseFmt {
  346    372   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  347    373   
    }
  348    374   
}
         375  +
/* ServerOperationGenerator.kt:88 */
  349    376   
         377  +
/* ServerOperationGenerator.kt:48 */
  350    378   
#[allow(missing_docs)] // documentation missing in model
         379  +
                       /* ServerOperationGenerator.kt:55 */
  351    380   
pub struct MalformedLengthOverride;
  352    381   
  353    382   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedLengthOverride {
  354    383   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  355    384   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  356    385   
            "aws.protocoltests.restjson.validation#MalformedLengthOverride",
  357    386   
            "aws.protocoltests.restjson.validation",
  358    387   
            "MalformedLengthOverride",
  359    388   
        );
  360    389   
  361    390   
    type Input = crate::input::MalformedLengthOverrideInput;
  362    391   
    type Output = crate::output::MalformedLengthOverrideOutput;
  363    392   
    type Error = crate::error::MalformedLengthOverrideError;
  364    393   
}
  365    394   
  366    395   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
  367    396   
    for MalformedLengthOverride
  368    397   
{
  369    398   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  370    399   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  371    400   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  372    401   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  373    402   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  374    403   
        >,
  375    404   
    >;
  376    405   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  377    406   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  378    407   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  379    408   
    >;
  380    409   
  381    410   
    fn request_fmt() -> Self::RequestFmt {
  382    411   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  383    412   
    }
  384    413   
  385    414   
    fn response_fmt() -> Self::ResponseFmt {
  386    415   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  387    416   
    }
  388    417   
}
         418  +
/* ServerOperationGenerator.kt:88 */
  389    419   
         420  +
/* ServerOperationGenerator.kt:48 */
  390    421   
#[allow(missing_docs)] // documentation missing in model
         422  +
                       /* ServerOperationGenerator.kt:55 */
  391    423   
pub struct MalformedLength;
  392    424   
  393    425   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedLength {
  394    426   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  395    427   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  396    428   
            "aws.protocoltests.restjson.validation#MalformedLength",
  397    429   
            "aws.protocoltests.restjson.validation",
  398    430   
            "MalformedLength",
  399    431   
        );
  400    432   
  401    433   
    type Input = crate::input::MalformedLengthInput;
  402    434   
    type Output = crate::output::MalformedLengthOutput;
  403    435   
    type Error = crate::error::MalformedLengthError;
  404    436   
}
  405    437   
  406    438   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for MalformedLength {
  407    439   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  408    440   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  409    441   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  410    442   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  411    443   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  412    444   
        >,
  413    445   
    >;
  414    446   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  415    447   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  416    448   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  417    449   
    >;
  418    450   
  419    451   
    fn request_fmt() -> Self::RequestFmt {
  420    452   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  421    453   
    }
  422    454   
  423    455   
    fn response_fmt() -> Self::ResponseFmt {
  424    456   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  425    457   
    }
  426    458   
}
         459  +
/* ServerOperationGenerator.kt:88 */
  427    460   
         461  +
/* ServerOperationGenerator.kt:48 */
  428    462   
#[allow(missing_docs)] // documentation missing in model
         463  +
                       /* ServerOperationGenerator.kt:55 */
  429    464   
pub struct MalformedEnum;
  430    465   
  431    466   
impl ::aws_smithy_http_server::operation::OperationShape for MalformedEnum {
  432    467   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  433    468   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  434    469   
            "aws.protocoltests.restjson.validation#MalformedEnum",
  435    470   
            "aws.protocoltests.restjson.validation",
  436    471   
            "MalformedEnum",
  437    472   
        );
  438    473   
  439    474   
    type Input = crate::input::MalformedEnumInput;
  440    475   
    type Output = crate::output::MalformedEnumOutput;
  441    476   
    type Error = crate::error::MalformedEnumError;
  442    477   
}
  443    478   
  444    479   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for MalformedEnum {
  445    480   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt<
  446    481   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  447    482   
        ::aws_smithy_http_server::instrumentation::sensitivity::uri::MakeUri<
  448    483   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  449    484   
            ::aws_smithy_http_server::instrumentation::MakeIdentity,
  450    485   
        >,
  451    486   
    >;
  452    487   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt<
  453    488   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  454    489   
        ::aws_smithy_http_server::instrumentation::MakeIdentity,
  455    490   
    >;
  456    491   
  457    492   
    fn request_fmt() -> Self::RequestFmt {
  458    493   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  459    494   
    }
  460    495   
  461    496   
    fn response_fmt() -> Self::ResponseFmt {
  462    497   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  463    498   
    }
  464    499   
}
         500  +
/* ServerOperationGenerator.kt:88 */

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/output.rs

@@ -1,1 +398,626 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* StructureGenerator.kt:197 */
    2      3   
#[allow(missing_docs)] // documentation missing in model
           4  +
/* RustType.kt:516 */
    3      5   
#[derive(
    4      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    5      7   
)]
    6         -
pub struct SensitiveValidationOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct SensitiveValidationOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ServerCodegenVisitor.kt:345 */
    7     10   
impl SensitiveValidationOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
          11  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
          12  +
    /* ServerBuilderGenerator.kt:295 */
    9     13   
    pub fn builder() -> crate::output::sensitive_validation_output::Builder {
          14  +
        /* ServerBuilderGenerator.kt:296 */
   10     15   
        crate::output::sensitive_validation_output::Builder::default()
          16  +
        /* ServerBuilderGenerator.kt:295 */
   11     17   
    }
          18  +
    /* ServerCodegenVisitor.kt:345 */
   12     19   
}
   13     20   
          21  +
/* StructureGenerator.kt:197 */
   14     22   
#[allow(missing_docs)] // documentation missing in model
          23  +
/* RustType.kt:516 */
   15     24   
#[derive(
   16     25   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   17     26   
)]
   18         -
pub struct RecursiveStructuresOutput {}
          27  +
pub /* StructureGenerator.kt:201 */ struct RecursiveStructuresOutput {/* StructureGenerator.kt:201 */}
          28  +
/* ServerCodegenVisitor.kt:345 */
   19     29   
impl RecursiveStructuresOutput {
   20         -
    /// Creates a new builder-style object to manufacture [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
          30  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
          31  +
    /* ServerBuilderGenerator.kt:295 */
   21     32   
    pub fn builder() -> crate::output::recursive_structures_output::Builder {
          33  +
        /* ServerBuilderGenerator.kt:296 */
   22     34   
        crate::output::recursive_structures_output::Builder::default()
          35  +
        /* ServerBuilderGenerator.kt:295 */
   23     36   
    }
          37  +
    /* ServerCodegenVisitor.kt:345 */
   24     38   
}
   25     39   
          40  +
/* StructureGenerator.kt:197 */
   26     41   
#[allow(missing_docs)] // documentation missing in model
          42  +
/* RustType.kt:516 */
   27     43   
#[derive(
   28     44   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   29     45   
)]
   30         -
pub struct MalformedUniqueItemsOutput {}
          46  +
pub /* StructureGenerator.kt:201 */ struct MalformedUniqueItemsOutput {/* StructureGenerator.kt:201 */}
          47  +
/* ServerCodegenVisitor.kt:345 */
   31     48   
impl MalformedUniqueItemsOutput {
   32         -
    /// Creates a new builder-style object to manufacture [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
          49  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
          50  +
    /* ServerBuilderGenerator.kt:295 */
   33     51   
    pub fn builder() -> crate::output::malformed_unique_items_output::Builder {
          52  +
        /* ServerBuilderGenerator.kt:296 */
   34     53   
        crate::output::malformed_unique_items_output::Builder::default()
          54  +
        /* ServerBuilderGenerator.kt:295 */
   35     55   
    }
          56  +
    /* ServerCodegenVisitor.kt:345 */
   36     57   
}
   37     58   
          59  +
/* StructureGenerator.kt:197 */
   38     60   
#[allow(missing_docs)] // documentation missing in model
          61  +
/* RustType.kt:516 */
   39     62   
#[derive(
   40     63   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   41     64   
)]
   42         -
pub struct MalformedRequiredOutput {}
          65  +
pub /* StructureGenerator.kt:201 */ struct MalformedRequiredOutput {/* StructureGenerator.kt:201 */}
          66  +
/* ServerCodegenVisitor.kt:345 */
   43     67   
impl MalformedRequiredOutput {
   44         -
    /// Creates a new builder-style object to manufacture [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
          68  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
          69  +
    /* ServerBuilderGenerator.kt:295 */
   45     70   
    pub fn builder() -> crate::output::malformed_required_output::Builder {
          71  +
        /* ServerBuilderGenerator.kt:296 */
   46     72   
        crate::output::malformed_required_output::Builder::default()
          73  +
        /* ServerBuilderGenerator.kt:295 */
   47     74   
    }
          75  +
    /* ServerCodegenVisitor.kt:345 */
   48     76   
}
   49     77   
          78  +
/* StructureGenerator.kt:197 */
   50     79   
#[allow(missing_docs)] // documentation missing in model
          80  +
/* RustType.kt:516 */
   51     81   
#[derive(
   52     82   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   53     83   
)]
   54         -
pub struct MalformedRangeOverrideOutput {}
          84  +
pub /* StructureGenerator.kt:201 */ struct MalformedRangeOverrideOutput {/* StructureGenerator.kt:201 */}
          85  +
/* ServerCodegenVisitor.kt:345 */
   55     86   
impl MalformedRangeOverrideOutput {
   56         -
    /// Creates a new builder-style object to manufacture [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
          87  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
          88  +
    /* ServerBuilderGenerator.kt:295 */
   57     89   
    pub fn builder() -> crate::output::malformed_range_override_output::Builder {
          90  +
        /* ServerBuilderGenerator.kt:296 */
   58     91   
        crate::output::malformed_range_override_output::Builder::default()
          92  +
        /* ServerBuilderGenerator.kt:295 */
   59     93   
    }
          94  +
    /* ServerCodegenVisitor.kt:345 */
   60     95   
}
   61     96   
          97  +
/* StructureGenerator.kt:197 */
   62     98   
#[allow(missing_docs)] // documentation missing in model
          99  +
/* RustType.kt:516 */
   63    100   
#[derive(
   64    101   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   65    102   
)]
   66         -
pub struct MalformedRangeOutput {}
         103  +
pub /* StructureGenerator.kt:201 */ struct MalformedRangeOutput {/* StructureGenerator.kt:201 */}
         104  +
/* ServerCodegenVisitor.kt:345 */
   67    105   
impl MalformedRangeOutput {
   68         -
    /// Creates a new builder-style object to manufacture [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         106  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         107  +
    /* ServerBuilderGenerator.kt:295 */
   69    108   
    pub fn builder() -> crate::output::malformed_range_output::Builder {
         109  +
        /* ServerBuilderGenerator.kt:296 */
   70    110   
        crate::output::malformed_range_output::Builder::default()
         111  +
        /* ServerBuilderGenerator.kt:295 */
   71    112   
    }
         113  +
    /* ServerCodegenVisitor.kt:345 */
   72    114   
}
   73    115   
         116  +
/* StructureGenerator.kt:197 */
   74    117   
#[allow(missing_docs)] // documentation missing in model
         118  +
/* RustType.kt:516 */
   75    119   
#[derive(
   76    120   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   77    121   
)]
   78         -
pub struct MalformedPatternOverrideOutput {}
         122  +
pub /* StructureGenerator.kt:201 */ struct MalformedPatternOverrideOutput {/* StructureGenerator.kt:201 */}
         123  +
/* ServerCodegenVisitor.kt:345 */
   79    124   
impl MalformedPatternOverrideOutput {
   80         -
    /// Creates a new builder-style object to manufacture [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         125  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         126  +
    /* ServerBuilderGenerator.kt:295 */
   81    127   
    pub fn builder() -> crate::output::malformed_pattern_override_output::Builder {
         128  +
        /* ServerBuilderGenerator.kt:296 */
   82    129   
        crate::output::malformed_pattern_override_output::Builder::default()
         130  +
        /* ServerBuilderGenerator.kt:295 */
   83    131   
    }
         132  +
    /* ServerCodegenVisitor.kt:345 */
   84    133   
}
   85    134   
         135  +
/* StructureGenerator.kt:197 */
   86    136   
#[allow(missing_docs)] // documentation missing in model
         137  +
/* RustType.kt:516 */
   87    138   
#[derive(
   88    139   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   89    140   
)]
   90         -
pub struct MalformedPatternOutput {}
         141  +
pub /* StructureGenerator.kt:201 */ struct MalformedPatternOutput {/* StructureGenerator.kt:201 */}
         142  +
/* ServerCodegenVisitor.kt:345 */
   91    143   
impl MalformedPatternOutput {
   92         -
    /// Creates a new builder-style object to manufacture [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         144  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         145  +
    /* ServerBuilderGenerator.kt:295 */
   93    146   
    pub fn builder() -> crate::output::malformed_pattern_output::Builder {
         147  +
        /* ServerBuilderGenerator.kt:296 */
   94    148   
        crate::output::malformed_pattern_output::Builder::default()
         149  +
        /* ServerBuilderGenerator.kt:295 */
   95    150   
    }
         151  +
    /* ServerCodegenVisitor.kt:345 */
   96    152   
}
   97    153   
         154  +
/* StructureGenerator.kt:197 */
   98    155   
#[allow(missing_docs)] // documentation missing in model
         156  +
/* RustType.kt:516 */
   99    157   
#[derive(
  100    158   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  101    159   
)]
  102         -
pub struct MalformedLengthQueryStringOutput {}
         160  +
pub /* StructureGenerator.kt:201 */ struct MalformedLengthQueryStringOutput {/* StructureGenerator.kt:201 */}
         161  +
/* ServerCodegenVisitor.kt:345 */
  103    162   
impl MalformedLengthQueryStringOutput {
  104         -
    /// Creates a new builder-style object to manufacture [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         163  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         164  +
    /* ServerBuilderGenerator.kt:295 */
  105    165   
    pub fn builder() -> crate::output::malformed_length_query_string_output::Builder {
         166  +
        /* ServerBuilderGenerator.kt:296 */
  106    167   
        crate::output::malformed_length_query_string_output::Builder::default()
         168  +
        /* ServerBuilderGenerator.kt:295 */
  107    169   
    }
         170  +
    /* ServerCodegenVisitor.kt:345 */
  108    171   
}
  109    172   
         173  +
/* StructureGenerator.kt:197 */
  110    174   
#[allow(missing_docs)] // documentation missing in model
         175  +
/* RustType.kt:516 */
  111    176   
#[derive(
  112    177   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  113    178   
)]
  114         -
pub struct MalformedLengthOverrideOutput {}
         179  +
pub /* StructureGenerator.kt:201 */ struct MalformedLengthOverrideOutput {/* StructureGenerator.kt:201 */}
         180  +
/* ServerCodegenVisitor.kt:345 */
  115    181   
impl MalformedLengthOverrideOutput {
  116         -
    /// Creates a new builder-style object to manufacture [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         182  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         183  +
    /* ServerBuilderGenerator.kt:295 */
  117    184   
    pub fn builder() -> crate::output::malformed_length_override_output::Builder {
         185  +
        /* ServerBuilderGenerator.kt:296 */
  118    186   
        crate::output::malformed_length_override_output::Builder::default()
         187  +
        /* ServerBuilderGenerator.kt:295 */
  119    188   
    }
         189  +
    /* ServerCodegenVisitor.kt:345 */
  120    190   
}
  121    191   
         192  +
/* StructureGenerator.kt:197 */
  122    193   
#[allow(missing_docs)] // documentation missing in model
         194  +
/* RustType.kt:516 */
  123    195   
#[derive(
  124    196   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  125    197   
)]
  126         -
pub struct MalformedLengthOutput {}
         198  +
pub /* StructureGenerator.kt:201 */ struct MalformedLengthOutput {/* StructureGenerator.kt:201 */}
         199  +
/* ServerCodegenVisitor.kt:345 */
  127    200   
impl MalformedLengthOutput {
  128         -
    /// Creates a new builder-style object to manufacture [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         201  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         202  +
    /* ServerBuilderGenerator.kt:295 */
  129    203   
    pub fn builder() -> crate::output::malformed_length_output::Builder {
         204  +
        /* ServerBuilderGenerator.kt:296 */
  130    205   
        crate::output::malformed_length_output::Builder::default()
         206  +
        /* ServerBuilderGenerator.kt:295 */
  131    207   
    }
         208  +
    /* ServerCodegenVisitor.kt:345 */
  132    209   
}
  133    210   
         211  +
/* StructureGenerator.kt:197 */
  134    212   
#[allow(missing_docs)] // documentation missing in model
         213  +
/* RustType.kt:516 */
  135    214   
#[derive(
  136    215   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  137    216   
)]
  138         -
pub struct MalformedEnumOutput {}
         217  +
pub /* StructureGenerator.kt:201 */ struct MalformedEnumOutput {/* StructureGenerator.kt:201 */}
         218  +
/* ServerCodegenVisitor.kt:345 */
  139    219   
impl MalformedEnumOutput {
  140         -
    /// Creates a new builder-style object to manufacture [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         220  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         221  +
    /* ServerBuilderGenerator.kt:295 */
  141    222   
    pub fn builder() -> crate::output::malformed_enum_output::Builder {
         223  +
        /* ServerBuilderGenerator.kt:296 */
  142    224   
        crate::output::malformed_enum_output::Builder::default()
         225  +
        /* ServerBuilderGenerator.kt:295 */
  143    226   
    }
         227  +
    /* ServerCodegenVisitor.kt:345 */
  144    228   
}
  145         -
/// See [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
         229  +
/// /* ServerBuilderGenerator.kt:171 */See [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
  146    230   
pub mod sensitive_validation_output {
  147    231   
         232  +
    /* ServerBuilderGenerator.kt:461 */
  148    233   
    impl ::std::convert::From<Builder> for crate::output::SensitiveValidationOutput {
  149    234   
        fn from(builder: Builder) -> Self {
  150    235   
            builder.build()
  151    236   
        }
  152    237   
    }
  153         -
    /// A builder for [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
         238  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
         239  +
    /* RustType.kt:516 */
  154    240   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  155         -
    pub struct Builder {}
         241  +
    /* ServerBuilderGenerator.kt:211 */
         242  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         243  +
    /* ServerBuilderGenerator.kt:215 */
  156    244   
    impl Builder {
  157         -
        /// Consumes the builder and constructs a [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
         245  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`SensitiveValidationOutput`](crate::output::SensitiveValidationOutput).
         246  +
        /* ServerBuilderGenerator.kt:271 */
  158    247   
        pub fn build(self) -> crate::output::SensitiveValidationOutput {
  159    248   
            self.build_enforcing_all_constraints()
  160    249   
        }
         250  +
        /* ServerBuilderGenerator.kt:283 */
  161    251   
        fn build_enforcing_all_constraints(self) -> crate::output::SensitiveValidationOutput {
  162         -
            crate::output::SensitiveValidationOutput {}
         252  +
            /* ServerBuilderGenerator.kt:542 */
         253  +
            crate::output::SensitiveValidationOutput {
         254  +
            /* ServerBuilderGenerator.kt:542 */}
         255  +
            /* ServerBuilderGenerator.kt:283 */
  163    256   
        }
         257  +
        /* ServerBuilderGenerator.kt:215 */
  164    258   
    }
         259  +
         260  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  165    261   
}
  166         -
/// See [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
         262  +
/// /* ServerBuilderGenerator.kt:171 */See [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
  167    263   
pub mod recursive_structures_output {
  168    264   
         265  +
    /* ServerBuilderGenerator.kt:461 */
  169    266   
    impl ::std::convert::From<Builder> for crate::output::RecursiveStructuresOutput {
  170    267   
        fn from(builder: Builder) -> Self {
  171    268   
            builder.build()
  172    269   
        }
  173    270   
    }
  174         -
    /// A builder for [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
         271  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
         272  +
    /* RustType.kt:516 */
  175    273   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  176         -
    pub struct Builder {}
         274  +
    /* ServerBuilderGenerator.kt:211 */
         275  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         276  +
    /* ServerBuilderGenerator.kt:215 */
  177    277   
    impl Builder {
  178         -
        /// Consumes the builder and constructs a [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
         278  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`RecursiveStructuresOutput`](crate::output::RecursiveStructuresOutput).
         279  +
        /* ServerBuilderGenerator.kt:271 */
  179    280   
        pub fn build(self) -> crate::output::RecursiveStructuresOutput {
  180    281   
            self.build_enforcing_all_constraints()
  181    282   
        }
         283  +
        /* ServerBuilderGenerator.kt:283 */
  182    284   
        fn build_enforcing_all_constraints(self) -> crate::output::RecursiveStructuresOutput {
  183         -
            crate::output::RecursiveStructuresOutput {}
         285  +
            /* ServerBuilderGenerator.kt:542 */
         286  +
            crate::output::RecursiveStructuresOutput {
         287  +
            /* ServerBuilderGenerator.kt:542 */}
         288  +
            /* ServerBuilderGenerator.kt:283 */
  184    289   
        }
         290  +
        /* ServerBuilderGenerator.kt:215 */
  185    291   
    }
         292  +
         293  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  186    294   
}
  187         -
/// See [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
         295  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
  188    296   
pub mod malformed_unique_items_output {
  189    297   
         298  +
    /* ServerBuilderGenerator.kt:461 */
  190    299   
    impl ::std::convert::From<Builder> for crate::output::MalformedUniqueItemsOutput {
  191    300   
        fn from(builder: Builder) -> Self {
  192    301   
            builder.build()
  193    302   
        }
  194    303   
    }
  195         -
    /// A builder for [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
         304  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
         305  +
    /* RustType.kt:516 */
  196    306   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  197         -
    pub struct Builder {}
         307  +
    /* ServerBuilderGenerator.kt:211 */
         308  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         309  +
    /* ServerBuilderGenerator.kt:215 */
  198    310   
    impl Builder {
  199         -
        /// Consumes the builder and constructs a [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
         311  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedUniqueItemsOutput`](crate::output::MalformedUniqueItemsOutput).
         312  +
        /* ServerBuilderGenerator.kt:271 */
  200    313   
        pub fn build(self) -> crate::output::MalformedUniqueItemsOutput {
  201    314   
            self.build_enforcing_all_constraints()
  202    315   
        }
         316  +
        /* ServerBuilderGenerator.kt:283 */
  203    317   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedUniqueItemsOutput {
  204         -
            crate::output::MalformedUniqueItemsOutput {}
         318  +
            /* ServerBuilderGenerator.kt:542 */
         319  +
            crate::output::MalformedUniqueItemsOutput {
         320  +
            /* ServerBuilderGenerator.kt:542 */}
         321  +
            /* ServerBuilderGenerator.kt:283 */
  205    322   
        }
         323  +
        /* ServerBuilderGenerator.kt:215 */
  206    324   
    }
         325  +
         326  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  207    327   
}
  208         -
/// See [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
         328  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
  209    329   
pub mod malformed_required_output {
  210    330   
         331  +
    /* ServerBuilderGenerator.kt:461 */
  211    332   
    impl ::std::convert::From<Builder> for crate::output::MalformedRequiredOutput {
  212    333   
        fn from(builder: Builder) -> Self {
  213    334   
            builder.build()
  214    335   
        }
  215    336   
    }
  216         -
    /// A builder for [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
         337  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
         338  +
    /* RustType.kt:516 */
  217    339   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  218         -
    pub struct Builder {}
         340  +
    /* ServerBuilderGenerator.kt:211 */
         341  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         342  +
    /* ServerBuilderGenerator.kt:215 */
  219    343   
    impl Builder {
  220         -
        /// Consumes the builder and constructs a [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
         344  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedRequiredOutput`](crate::output::MalformedRequiredOutput).
         345  +
        /* ServerBuilderGenerator.kt:271 */
  221    346   
        pub fn build(self) -> crate::output::MalformedRequiredOutput {
  222    347   
            self.build_enforcing_all_constraints()
  223    348   
        }
         349  +
        /* ServerBuilderGenerator.kt:283 */
  224    350   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedRequiredOutput {
  225         -
            crate::output::MalformedRequiredOutput {}
         351  +
            /* ServerBuilderGenerator.kt:542 */
         352  +
            crate::output::MalformedRequiredOutput {
         353  +
            /* ServerBuilderGenerator.kt:542 */}
         354  +
            /* ServerBuilderGenerator.kt:283 */
  226    355   
        }
         356  +
        /* ServerBuilderGenerator.kt:215 */
  227    357   
    }
         358  +
         359  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  228    360   
}
  229         -
/// See [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
         361  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
  230    362   
pub mod malformed_range_override_output {
  231    363   
         364  +
    /* ServerBuilderGenerator.kt:461 */
  232    365   
    impl ::std::convert::From<Builder> for crate::output::MalformedRangeOverrideOutput {
  233    366   
        fn from(builder: Builder) -> Self {
  234    367   
            builder.build()
  235    368   
        }
  236    369   
    }
  237         -
    /// A builder for [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
         370  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
         371  +
    /* RustType.kt:516 */
  238    372   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  239         -
    pub struct Builder {}
         373  +
    /* ServerBuilderGenerator.kt:211 */
         374  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         375  +
    /* ServerBuilderGenerator.kt:215 */
  240    376   
    impl Builder {
  241         -
        /// Consumes the builder and constructs a [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
         377  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedRangeOverrideOutput`](crate::output::MalformedRangeOverrideOutput).
         378  +
        /* ServerBuilderGenerator.kt:271 */
  242    379   
        pub fn build(self) -> crate::output::MalformedRangeOverrideOutput {
  243    380   
            self.build_enforcing_all_constraints()
  244    381   
        }
         382  +
        /* ServerBuilderGenerator.kt:283 */
  245    383   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedRangeOverrideOutput {
  246         -
            crate::output::MalformedRangeOverrideOutput {}
         384  +
            /* ServerBuilderGenerator.kt:542 */
         385  +
            crate::output::MalformedRangeOverrideOutput {
         386  +
            /* ServerBuilderGenerator.kt:542 */}
         387  +
            /* ServerBuilderGenerator.kt:283 */
  247    388   
        }
         389  +
        /* ServerBuilderGenerator.kt:215 */
  248    390   
    }
         391  +
         392  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  249    393   
}
  250         -
/// See [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         394  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
  251    395   
pub mod malformed_range_output {
  252    396   
         397  +
    /* ServerBuilderGenerator.kt:461 */
  253    398   
    impl ::std::convert::From<Builder> for crate::output::MalformedRangeOutput {
  254    399   
        fn from(builder: Builder) -> Self {
  255    400   
            builder.build()
  256    401   
        }
  257    402   
    }
  258         -
    /// A builder for [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         403  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         404  +
    /* RustType.kt:516 */
  259    405   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  260         -
    pub struct Builder {}
         406  +
    /* ServerBuilderGenerator.kt:211 */
         407  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         408  +
    /* ServerBuilderGenerator.kt:215 */
  261    409   
    impl Builder {
  262         -
        /// Consumes the builder and constructs a [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         410  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedRangeOutput`](crate::output::MalformedRangeOutput).
         411  +
        /* ServerBuilderGenerator.kt:271 */
  263    412   
        pub fn build(self) -> crate::output::MalformedRangeOutput {
  264    413   
            self.build_enforcing_all_constraints()
  265    414   
        }
         415  +
        /* ServerBuilderGenerator.kt:283 */
  266    416   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedRangeOutput {
  267         -
            crate::output::MalformedRangeOutput {}
         417  +
            /* ServerBuilderGenerator.kt:542 */
         418  +
            crate::output::MalformedRangeOutput {
         419  +
            /* ServerBuilderGenerator.kt:542 */}
         420  +
            /* ServerBuilderGenerator.kt:283 */
  268    421   
        }
         422  +
        /* ServerBuilderGenerator.kt:215 */
  269    423   
    }
         424  +
         425  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  270    426   
}
  271         -
/// See [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         427  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
  272    428   
pub mod malformed_pattern_override_output {
  273    429   
         430  +
    /* ServerBuilderGenerator.kt:461 */
  274    431   
    impl ::std::convert::From<Builder> for crate::output::MalformedPatternOverrideOutput {
  275    432   
        fn from(builder: Builder) -> Self {
  276    433   
            builder.build()
  277    434   
        }
  278    435   
    }
  279         -
    /// A builder for [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         436  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         437  +
    /* RustType.kt:516 */
  280    438   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  281         -
    pub struct Builder {}
         439  +
    /* ServerBuilderGenerator.kt:211 */
         440  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         441  +
    /* ServerBuilderGenerator.kt:215 */
  282    442   
    impl Builder {
  283         -
        /// Consumes the builder and constructs a [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         443  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedPatternOverrideOutput`](crate::output::MalformedPatternOverrideOutput).
         444  +
        /* ServerBuilderGenerator.kt:271 */
  284    445   
        pub fn build(self) -> crate::output::MalformedPatternOverrideOutput {
  285    446   
            self.build_enforcing_all_constraints()
  286    447   
        }
         448  +
        /* ServerBuilderGenerator.kt:283 */
  287    449   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedPatternOverrideOutput {
  288         -
            crate::output::MalformedPatternOverrideOutput {}
         450  +
            /* ServerBuilderGenerator.kt:542 */
         451  +
            crate::output::MalformedPatternOverrideOutput {
         452  +
            /* ServerBuilderGenerator.kt:542 */}
         453  +
            /* ServerBuilderGenerator.kt:283 */
  289    454   
        }
         455  +
        /* ServerBuilderGenerator.kt:215 */
  290    456   
    }
         457  +
         458  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  291    459   
}
  292         -
/// See [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         460  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
  293    461   
pub mod malformed_pattern_output {
  294    462   
         463  +
    /* ServerBuilderGenerator.kt:461 */
  295    464   
    impl ::std::convert::From<Builder> for crate::output::MalformedPatternOutput {
  296    465   
        fn from(builder: Builder) -> Self {
  297    466   
            builder.build()
  298    467   
        }
  299    468   
    }
  300         -
    /// A builder for [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         469  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         470  +
    /* RustType.kt:516 */
  301    471   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  302         -
    pub struct Builder {}
         472  +
    /* ServerBuilderGenerator.kt:211 */
         473  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         474  +
    /* ServerBuilderGenerator.kt:215 */
  303    475   
    impl Builder {
  304         -
        /// Consumes the builder and constructs a [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         476  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedPatternOutput`](crate::output::MalformedPatternOutput).
         477  +
        /* ServerBuilderGenerator.kt:271 */
  305    478   
        pub fn build(self) -> crate::output::MalformedPatternOutput {
  306    479   
            self.build_enforcing_all_constraints()
  307    480   
        }
         481  +
        /* ServerBuilderGenerator.kt:283 */
  308    482   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedPatternOutput {
  309         -
            crate::output::MalformedPatternOutput {}
         483  +
            /* ServerBuilderGenerator.kt:542 */
         484  +
            crate::output::MalformedPatternOutput {
         485  +
            /* ServerBuilderGenerator.kt:542 */}
         486  +
            /* ServerBuilderGenerator.kt:283 */
  310    487   
        }
         488  +
        /* ServerBuilderGenerator.kt:215 */
  311    489   
    }
         490  +
         491  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  312    492   
}
  313         -
/// See [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         493  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
  314    494   
pub mod malformed_length_query_string_output {
  315    495   
         496  +
    /* ServerBuilderGenerator.kt:461 */
  316    497   
    impl ::std::convert::From<Builder> for crate::output::MalformedLengthQueryStringOutput {
  317    498   
        fn from(builder: Builder) -> Self {
  318    499   
            builder.build()
  319    500   
        }
  320    501   
    }
  321         -
    /// A builder for [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         502  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         503  +
    /* RustType.kt:516 */
  322    504   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  323         -
    pub struct Builder {}
         505  +
    /* ServerBuilderGenerator.kt:211 */
         506  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         507  +
    /* ServerBuilderGenerator.kt:215 */
  324    508   
    impl Builder {
  325         -
        /// Consumes the builder and constructs a [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         509  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedLengthQueryStringOutput`](crate::output::MalformedLengthQueryStringOutput).
         510  +
        /* ServerBuilderGenerator.kt:271 */
  326    511   
        pub fn build(self) -> crate::output::MalformedLengthQueryStringOutput {
  327    512   
            self.build_enforcing_all_constraints()
  328    513   
        }
         514  +
        /* ServerBuilderGenerator.kt:283 */
  329    515   
        fn build_enforcing_all_constraints(
  330    516   
            self,
  331    517   
        ) -> crate::output::MalformedLengthQueryStringOutput {
  332         -
            crate::output::MalformedLengthQueryStringOutput {}
         518  +
            /* ServerBuilderGenerator.kt:542 */
         519  +
            crate::output::MalformedLengthQueryStringOutput {
         520  +
            /* ServerBuilderGenerator.kt:542 */}
         521  +
            /* ServerBuilderGenerator.kt:283 */
  333    522   
        }
         523  +
        /* ServerBuilderGenerator.kt:215 */
  334    524   
    }
         525  +
         526  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  335    527   
}
  336         -
/// See [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         528  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
  337    529   
pub mod malformed_length_override_output {
  338    530   
         531  +
    /* ServerBuilderGenerator.kt:461 */
  339    532   
    impl ::std::convert::From<Builder> for crate::output::MalformedLengthOverrideOutput {
  340    533   
        fn from(builder: Builder) -> Self {
  341    534   
            builder.build()
  342    535   
        }
  343    536   
    }
  344         -
    /// A builder for [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         537  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         538  +
    /* RustType.kt:516 */
  345    539   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  346         -
    pub struct Builder {}
         540  +
    /* ServerBuilderGenerator.kt:211 */
         541  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         542  +
    /* ServerBuilderGenerator.kt:215 */
  347    543   
    impl Builder {
  348         -
        /// Consumes the builder and constructs a [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         544  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedLengthOverrideOutput`](crate::output::MalformedLengthOverrideOutput).
         545  +
        /* ServerBuilderGenerator.kt:271 */
  349    546   
        pub fn build(self) -> crate::output::MalformedLengthOverrideOutput {
  350    547   
            self.build_enforcing_all_constraints()
  351    548   
        }
         549  +
        /* ServerBuilderGenerator.kt:283 */
  352    550   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedLengthOverrideOutput {
  353         -
            crate::output::MalformedLengthOverrideOutput {}
         551  +
            /* ServerBuilderGenerator.kt:542 */
         552  +
            crate::output::MalformedLengthOverrideOutput {
         553  +
            /* ServerBuilderGenerator.kt:542 */}
         554  +
            /* ServerBuilderGenerator.kt:283 */
  354    555   
        }
         556  +
        /* ServerBuilderGenerator.kt:215 */
  355    557   
    }
         558  +
         559  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  356    560   
}
  357         -
/// See [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         561  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
  358    562   
pub mod malformed_length_output {
  359    563   
         564  +
    /* ServerBuilderGenerator.kt:461 */
  360    565   
    impl ::std::convert::From<Builder> for crate::output::MalformedLengthOutput {
  361    566   
        fn from(builder: Builder) -> Self {
  362    567   
            builder.build()
  363    568   
        }
  364    569   
    }
  365         -
    /// A builder for [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         570  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         571  +
    /* RustType.kt:516 */
  366    572   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  367         -
    pub struct Builder {}
         573  +
    /* ServerBuilderGenerator.kt:211 */
         574  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         575  +
    /* ServerBuilderGenerator.kt:215 */
  368    576   
    impl Builder {
  369         -
        /// Consumes the builder and constructs a [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         577  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedLengthOutput`](crate::output::MalformedLengthOutput).
         578  +
        /* ServerBuilderGenerator.kt:271 */
  370    579   
        pub fn build(self) -> crate::output::MalformedLengthOutput {
  371    580   
            self.build_enforcing_all_constraints()
  372    581   
        }
         582  +
        /* ServerBuilderGenerator.kt:283 */
  373    583   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedLengthOutput {
  374         -
            crate::output::MalformedLengthOutput {}
         584  +
            /* ServerBuilderGenerator.kt:542 */
         585  +
            crate::output::MalformedLengthOutput {
         586  +
            /* ServerBuilderGenerator.kt:542 */}
         587  +
            /* ServerBuilderGenerator.kt:283 */
  375    588   
        }
         589  +
        /* ServerBuilderGenerator.kt:215 */
  376    590   
    }
         591  +
         592  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  377    593   
}
  378         -
/// See [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         594  +
/// /* ServerBuilderGenerator.kt:171 */See [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
  379    595   
pub mod malformed_enum_output {
  380    596   
         597  +
    /* ServerBuilderGenerator.kt:461 */
  381    598   
    impl ::std::convert::From<Builder> for crate::output::MalformedEnumOutput {
  382    599   
        fn from(builder: Builder) -> Self {
  383    600   
            builder.build()
  384    601   
        }
  385    602   
    }
  386         -
    /// A builder for [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         603  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         604  +
    /* RustType.kt:516 */
  387    605   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  388         -
    pub struct Builder {}
         606  +
    /* ServerBuilderGenerator.kt:211 */
         607  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         608  +
    /* ServerBuilderGenerator.kt:215 */
  389    609   
    impl Builder {
  390         -
        /// Consumes the builder and constructs a [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         610  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MalformedEnumOutput`](crate::output::MalformedEnumOutput).
         611  +
        /* ServerBuilderGenerator.kt:271 */
  391    612   
        pub fn build(self) -> crate::output::MalformedEnumOutput {
  392    613   
            self.build_enforcing_all_constraints()
  393    614   
        }
         615  +
        /* ServerBuilderGenerator.kt:283 */
  394    616   
        fn build_enforcing_all_constraints(self) -> crate::output::MalformedEnumOutput {
  395         -
            crate::output::MalformedEnumOutput {}
         617  +
            /* ServerBuilderGenerator.kt:542 */
         618  +
            crate::output::MalformedEnumOutput {
         619  +
            /* ServerBuilderGenerator.kt:542 */}
         620  +
            /* ServerBuilderGenerator.kt:283 */
  396    621   
        }
         622  +
        /* ServerBuilderGenerator.kt:215 */
  397    623   
    }
         624  +
         625  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  398    626   
}

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

@@ -1,1 +55,56 @@
   16     16   
pub(crate) mod shape_malformed_range_override;
   17     17   
   18     18   
pub(crate) mod shape_malformed_required;
   19     19   
   20     20   
pub(crate) mod shape_malformed_unique_items;
   21     21   
   22     22   
pub(crate) mod shape_recursive_structures;
   23     23   
   24     24   
pub(crate) mod shape_sensitive_validation;
   25     25   
          26  +
/* JsonParserGenerator.kt:227 */
   26     27   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   27     28   
    if data.is_empty() {
   28     29   
        b"{}"
   29     30   
    } else {
   30     31   
        data
   31     32   
    }
   32     33   
}
   33     34   
   34     35   
pub(crate) mod shape_malformed_length_query_string_input;
   35     36   

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_blob_set.rs

@@ -1,1 +52,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_blob_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::blob_set_unconstrained::BlobSetUnconstrained>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_blob_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:326 */::aws_smithy_json::deserialize::token::expect_blob_or_null(tokens.next())?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   30     42   
                        if let Some(value) = value {
   31     43   
                            items.push(value);
   32         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   33     47   
                            return Err(
   34     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35     49   
                                    "dense list cannot contain null values",
   36     50   
                                ),
   37     51   
                            );
   38     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   39     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   40     57   
            }
   41         -
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   42     59   
            Ok(Some(
   43     60   
                crate::unconstrained::blob_set_unconstrained::BlobSetUnconstrained(items),
   44     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   47     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     69   
                    "expected start array or null",
   49     70   
                ),
   50         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   52     76   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_boolean_set.rs

@@ -1,1 +52,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_boolean_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::boolean_set_unconstrained::BooleanSetUnconstrained>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:298 */::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   30     42   
                        if let Some(value) = value {
   31     43   
                            items.push(value);
   32         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   33     47   
                            return Err(
   34     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   35     49   
                                    "dense list cannot contain null values",
   36     50   
                                ),
   37     51   
                            );
   38     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   39     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   40     57   
            }
   41         -
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   42     59   
            Ok(Some(
   43     60   
                crate::unconstrained::boolean_set_unconstrained::BooleanSetUnconstrained(items),
   44     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   45     63   
        }
   46         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   47     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   48     69   
                    "expected start array or null",
   49     70   
                ),
   50         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   51     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   52     76   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_byte_set.rs

@@ -1,1 +54,78 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_byte_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::byte_set_unconstrained::ByteSetUnconstrained>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_number_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
          37  +
                        /* JsonParserGenerator.kt:419 */
          38  +
                        let value =
          39  +
                            /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   30     40   
                                                .map(i8::try_from)
   31         -
                        .transpose()?;
          41  +
                                                .transpose()?
          42  +
                        /* JsonParserGenerator.kt:419 */;
          43  +
                        /* JsonParserGenerator.kt:422 */
   32     44   
                        if let Some(value) = value {
   33     45   
                            items.push(value);
   34         -
                        } else {
          46  +
                        }
          47  +
                        /* JsonParserGenerator.kt:430 */
          48  +
                        else {
   35     49   
                            return Err(
   36     50   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     51   
                                    "dense list cannot contain null values",
   38     52   
                                ),
   39     53   
                            );
   40     54   
                        }
          55  +
                        /* JsonParserGenerator.kt:413 */
          56  +
                    } /* JsonParserGenerator.kt:409 */
   41     57   
                }
          58  +
                /* JsonParserGenerator.kt:408 */
   42     59   
            }
   43         -
            }
          60  +
            /* JsonParserGenerator.kt:444 */
   44     61   
            Ok(Some(
   45     62   
                crate::unconstrained::byte_set_unconstrained::ByteSetUnconstrained(items),
   46     63   
            ))
          64  +
            /* JsonParserGenerator.kt:713 */
   47     65   
        }
   48         -
        _ => Err(
          66  +
        /* JsonParserGenerator.kt:722 */
          67  +
        _ => {
          68  +
            /* JsonParserGenerator.kt:723 */
          69  +
            Err(
   49     70   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     71   
                    "expected start array or null",
   51     72   
                ),
   52         -
        ),
          73  +
            )
          74  +
            /* JsonParserGenerator.kt:722 */
          75  +
        } /* JsonParserGenerator.kt:712 */
   53     76   
    }
          77  +
    /* JsonParserGenerator.kt:398 */
   54     78   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_date_time_set.rs

@@ -1,1 +54,76 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_date_time_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::date_time_set_unconstrained::DateTimeSetUnconstrained>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
          37  +
                        /* JsonParserGenerator.kt:419 */
   27     38   
                        let value =
   28         -
                            ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
   29         -
                                tokens.next(),
   30         -
                                ::aws_smithy_types::date_time::Format::DateTime,
   31         -
                            )?;
          39  +
                            /* JsonParserGenerator.kt:384 */::aws_smithy_json::deserialize::token::expect_timestamp_or_null(tokens.next(), ::aws_smithy_types::date_time::Format::DateTime)?
          40  +
                        /* JsonParserGenerator.kt:419 */;
          41  +
                        /* JsonParserGenerator.kt:422 */
   32     42   
                        if let Some(value) = value {
   33     43   
                            items.push(value);
   34         -
                        } else {
          44  +
                        }
          45  +
                        /* JsonParserGenerator.kt:430 */
          46  +
                        else {
   35     47   
                            return Err(
   36     48   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     49   
                                    "dense list cannot contain null values",
   38     50   
                                ),
   39     51   
                            );
   40     52   
                        }
          53  +
                        /* JsonParserGenerator.kt:413 */
          54  +
                    } /* JsonParserGenerator.kt:409 */
   41     55   
                }
          56  +
                /* JsonParserGenerator.kt:408 */
   42     57   
            }
   43         -
            }
          58  +
            /* JsonParserGenerator.kt:444 */
   44     59   
            Ok(Some(
   45     60   
                crate::unconstrained::date_time_set_unconstrained::DateTimeSetUnconstrained(items),
   46     61   
            ))
          62  +
            /* JsonParserGenerator.kt:713 */
   47     63   
        }
   48         -
        _ => Err(
          64  +
        /* JsonParserGenerator.kt:722 */
          65  +
        _ => {
          66  +
            /* JsonParserGenerator.kt:723 */
          67  +
            Err(
   49     68   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     69   
                    "expected start array or null",
   51     70   
                ),
   52         -
        ),
          71  +
            )
          72  +
            /* JsonParserGenerator.kt:722 */
          73  +
        } /* JsonParserGenerator.kt:712 */
   53     74   
    }
          75  +
    /* JsonParserGenerator.kt:398 */
   54     76   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_enum_list.rs

@@ -1,1 +54,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_enum_list<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::enum_list_unconstrained::EnumListUnconstrained>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          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:343 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:444 */
   44     63   
            Ok(Some(
   45     64   
                crate::unconstrained::enum_list_unconstrained::EnumListUnconstrained(items),
   46     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
   49     72   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     73   
                    "expected start array or null",
   51     74   
                ),
   52         -
        ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_enum_map.rs

@@ -1,1 +62,89 @@
    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_enum_map<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::enum_map_unconstrained::EnumMapUnconstrained>,
    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:343 */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::enum_map_unconstrained::EnumMapUnconstrained(map),
   54     74   
            ))
          75  +
            /* JsonParserGenerator.kt:713 */
   55     76   
        }
   56         -
        _ => Err(
          77  +
        /* JsonParserGenerator.kt:722 */
          78  +
        _ => {
          79  +
            /* JsonParserGenerator.kt:723 */
          80  +
            Err(
   57     81   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   58     82   
                    "expected start object or null",
   59     83   
                ),
   60         -
        ),
          84  +
            )
          85  +
            /* JsonParserGenerator.kt:722 */
          86  +
        } /* JsonParserGenerator.kt:712 */
   61     87   
    }
          88  +
    /* JsonParserGenerator.kt:460 */
   62     89   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_enum_union.rs

@@ -1,1 +92,124 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_enum_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained>,
    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:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   20     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   21     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   23     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   24     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25     34   
                        )) = tokens.peek()
   26     35   
                        {
   27     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   28     37   
                            continue;
   29     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   30     40   
                        let key = key.to_unescaped()?;
   31     41   
                        if key == "__type" {
   32     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33     43   
                            continue;
   34     44   
                        }
   35     45   
                        if variant.is_some() {
   36     46   
                            return Err(
   37     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     48   
                                    "encountered mixed variants in union",
   39     49   
                                ),
   40     50   
                            );
   41     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   42     53   
                        variant = match key.as_ref() {
          54  +
                            /* JsonParserGenerator.kt:601 */
   43     55   
                            "first" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
   44     57   
                                Some(crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained::First(
   45         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
   46         -
                                        s.to_unescaped().map(|u|
   47         -
                                            u.into_owned()
   48         -
                                        )
   49         -
                                    ).transpose()?
   50         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'first' cannot be null"))?
   51         -
                                ))
          58  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          59  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          60  +
                                            /* JsonParserGenerator.kt:343 */u.into_owned()
          61  +
                                        /* JsonParserGenerator.kt:339 */)
          62  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          63  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'first' cannot be null"))?
          64  +
                                /* JsonParserGenerator.kt:611 */))
          65  +
                                /* JsonParserGenerator.kt:601 */
   52     66   
                            }
          67  +
                            /* JsonParserGenerator.kt:601 */
   53     68   
                            "second" => {
          69  +
                                /* JsonParserGenerator.kt:611 */
   54     70   
                                Some(crate::unconstrained::enum_union_unconstrained::EnumUnionUnconstrained::Second(
   55         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
   56         -
                                        s.to_unescaped().map(|u|
   57         -
                                            u.into_owned()
   58         -
                                        )
   59         -
                                    ).transpose()?
   60         -
                                    .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'second' cannot be null"))?
   61         -
                                ))
          71  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          72  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          73  +
                                            /* JsonParserGenerator.kt:343 */u.into_owned()
          74  +
                                        /* JsonParserGenerator.kt:339 */)
          75  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          76  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'second' cannot be null"))?
          77  +
                                /* JsonParserGenerator.kt:611 */))
          78  +
                                /* JsonParserGenerator.kt:601 */
   62     79   
                            }
   63         -
                            variant => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("unexpected union variant: {}", variant)))
          80  +
                            /* JsonParserGenerator.kt:634 */
          81  +
                            variant => {
          82  +
                                return Err(
          83  +
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          84  +
                                        format!("unexpected union variant: {}", variant),
          85  +
                                    ),
          86  +
                                )
          87  +
                            } /* JsonParserGenerator.kt:598 */
   64     88   
                        };
          89  +
                        /* JsonParserGenerator.kt:686 */
   65     90   
                    }
          91  +
                    /* JsonParserGenerator.kt:695 */
   66     92   
                    other => {
   67     93   
                        return Err(
   68         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   69         -
                            "expected object key or end object, found: {:?}",
   70         -
                            other
   71         -
                        )),
          94  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          95  +
                                format!("expected object key or end object, found: {:?}", other),
          96  +
                            ),
   72     97   
                        )
          98  +
                    } /* JsonParserGenerator.kt:685 */
   73     99   
                }
         100  +
                /* JsonParserGenerator.kt:684 */
   74    101   
            }
   75         -
        },
         102  +
            /* JsonParserGenerator.kt:568 */
         103  +
        }
         104  +
        /* JsonParserGenerator.kt:642 */
   76    105   
        _ => {
   77    106   
            return Err(
   78    107   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   79    108   
                    "expected start object or null",
   80    109   
                ),
   81    110   
            )
         111  +
        } /* JsonParserGenerator.kt:567 */
   82    112   
    }
   83         -
    }
         113  +
    /* JsonParserGenerator.kt:649 */
   84    114   
    if variant.is_none() {
   85    115   
        return Err(
   86    116   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   87    117   
                "Union did not contain a valid variant.",
   88    118   
            ),
   89    119   
        );
   90    120   
    }
         121  +
    /* JsonParserGenerator.kt:657 */
   91    122   
    Ok(variant)
         123  +
    /* JsonParserGenerator.kt:551 */
   92    124   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_foo_enum_set.rs

@@ -1,1 +54,80 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:398 */
    2      3   
pub(crate) fn de_foo_enum_set<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained>,
    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::StartArray { .. }) => {
          22  +
            /* JsonParserGenerator.kt:407 */
   19     23   
            let mut items = Vec::new();
          24  +
            /* JsonParserGenerator.kt:408 */
   20     25   
            loop {
          26  +
                /* JsonParserGenerator.kt:409 */
   21     27   
                match tokens.peek() {
          28  +
                    /* JsonParserGenerator.kt:410 */
   22     29   
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
          30  +
                        /* JsonParserGenerator.kt:411 */
   23     31   
                        tokens.next().transpose().unwrap();
   24     32   
                        break;
          33  +
                        /* JsonParserGenerator.kt:410 */
   25     34   
                    }
          35  +
                    /* JsonParserGenerator.kt:413 */
   26     36   
                    _ => {
   27         -
                        let value = ::aws_smithy_json::deserialize::token::expect_string_or_null(
   28         -
                            tokens.next(),
   29         -
                        )?
   30         -
                        .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   31         -
                        .transpose()?;
          37  +
                        /* JsonParserGenerator.kt:419 */
          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:343 */u.into_owned()
          42  +
                                /* JsonParserGenerator.kt:339 */)
          43  +
                            /* JsonParserGenerator.kt:354 */).transpose()?
          44  +
                        /* JsonParserGenerator.kt:419 */;
          45  +
                        /* JsonParserGenerator.kt:422 */
   32     46   
                        if let Some(value) = value {
   33     47   
                            items.push(value);
   34         -
                        } else {
          48  +
                        }
          49  +
                        /* JsonParserGenerator.kt:430 */
          50  +
                        else {
   35     51   
                            return Err(
   36     52   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37     53   
                                    "dense list cannot contain null values",
   38     54   
                                ),
   39     55   
                            );
   40     56   
                        }
          57  +
                        /* JsonParserGenerator.kt:413 */
          58  +
                    } /* JsonParserGenerator.kt:409 */
   41     59   
                }
          60  +
                /* JsonParserGenerator.kt:408 */
   42     61   
            }
   43         -
            }
          62  +
            /* JsonParserGenerator.kt:444 */
   44     63   
            Ok(Some(
   45     64   
                crate::unconstrained::foo_enum_set_unconstrained::FooEnumSetUnconstrained(items),
   46     65   
            ))
          66  +
            /* JsonParserGenerator.kt:713 */
   47     67   
        }
   48         -
        _ => Err(
          68  +
        /* JsonParserGenerator.kt:722 */
          69  +
        _ => {
          70  +
            /* JsonParserGenerator.kt:723 */
          71  +
            Err(
   49     72   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   50     73   
                    "expected start array or null",
   51     74   
                ),
   52         -
        ),
          75  +
            )
          76  +
            /* JsonParserGenerator.kt:722 */
          77  +
        } /* JsonParserGenerator.kt:712 */
   53     78   
    }
          79  +
    /* JsonParserGenerator.kt:398 */
   54     80   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_foo_union.rs

@@ -1,1 +102,122 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:551 */
    2      3   
pub(crate) fn de_foo_union<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::FooUnion>,
    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:565 */
   16     18   
    let mut variant = None;
          19  +
    /* JsonParserGenerator.kt:567 */
   17     20   
    match tokens.next().transpose()? {
          21  +
        /* JsonParserGenerator.kt:568 */
   18     22   
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
   19         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
          23  +
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
          24  +
            /* JsonParserGenerator.kt:684 */
          25  +
            loop {
          26  +
                /* JsonParserGenerator.kt:685 */
   20     27   
                match tokens.next().transpose()? {
          28  +
                    /* JsonParserGenerator.kt:686 */
   21     29   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   22     30   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          31  +
                        /* JsonParserGenerator.kt:576 */
   23     32   
                        if let ::std::option::Option::Some(::std::result::Result::Ok(
   24     33   
                            ::aws_smithy_json::deserialize::Token::ValueNull { .. },
   25     34   
                        )) = tokens.peek()
   26     35   
                        {
   27     36   
                            let _ = tokens.next().expect("peek returned a token")?;
   28     37   
                            continue;
   29     38   
                        }
          39  +
                        /* JsonParserGenerator.kt:585 */
   30     40   
                        let key = key.to_unescaped()?;
   31     41   
                        if key == "__type" {
   32     42   
                            ::aws_smithy_json::deserialize::token::skip_value(tokens)?;
   33     43   
                            continue;
   34     44   
                        }
   35     45   
                        if variant.is_some() {
   36     46   
                            return Err(
   37     47   
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   38     48   
                                    "encountered mixed variants in union",
   39     49   
                                ),
   40     50   
                            );
   41     51   
                        }
          52  +
                        /* JsonParserGenerator.kt:598 */
   42     53   
                        variant = match key.as_ref() {
   43         -
                        "string" => Some(crate::model::FooUnion::String(
   44         -
                            ::aws_smithy_json::deserialize::token::expect_string_or_null(
   45         -
                                tokens.next(),
   46         -
                            )?
   47         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   48         -
                            .transpose()?
   49         -
                            .ok_or_else(|| {
   50         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51         -
                                    "value for 'string' cannot be null",
   52         -
                                )
   53         -
                            })?,
   54         -
                        )),
   55         -
                        "integer" => Some(crate::model::FooUnion::Integer(
   56         -
                            ::aws_smithy_json::deserialize::token::expect_number_or_null(
   57         -
                                tokens.next(),
   58         -
                            )?
          54  +
                            /* JsonParserGenerator.kt:601 */
          55  +
                            "string" => {
          56  +
                                /* JsonParserGenerator.kt:611 */
          57  +
                                Some(crate::model::FooUnion::String(
          58  +
                                    /* JsonParserGenerator.kt:354 */::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
          59  +
                                        /* JsonParserGenerator.kt:339 */s.to_unescaped().map(|u|
          60  +
                                            /* JsonParserGenerator.kt:348 */u.into_owned()
          61  +
                                        /* JsonParserGenerator.kt:339 */)
          62  +
                                    /* JsonParserGenerator.kt:354 */).transpose()?
          63  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'string' cannot be null"))?
          64  +
                                /* JsonParserGenerator.kt:611 */))
          65  +
                                /* JsonParserGenerator.kt:601 */
          66  +
                            }
          67  +
                            /* JsonParserGenerator.kt:601 */
          68  +
                            "integer" => {
          69  +
                                /* JsonParserGenerator.kt:611 */
          70  +
                                Some(crate::model::FooUnion::Integer(
          71  +
                                    /* JsonParserGenerator.kt:365 */::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   59     72   
                                                        .map(i32::try_from)
   60     73   
                                                        .transpose()?
   61         -
                            .ok_or_else(|| {
   62         -
                                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   63         -
                                    "value for 'integer' cannot be null",
   64         -
                                )
   65         -
                            })?,
   66         -
                        )),
          74  +
                                    /* JsonParserGenerator.kt:670 */.ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'integer' cannot be null"))?
          75  +
                                /* JsonParserGenerator.kt:611 */))
          76  +
                                /* JsonParserGenerator.kt:601 */
          77  +
                            }
          78  +
                            /* JsonParserGenerator.kt:634 */
   67     79   
                            variant => {
   68     80   
                                return Err(
   69     81   
                                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   70     82   
                                        format!("unexpected union variant: {}", variant),
   71     83   
                                    ),
   72     84   
                                )
   73         -
                        }
          85  +
                            } /* JsonParserGenerator.kt:598 */
   74     86   
                        };
          87  +
                        /* JsonParserGenerator.kt:686 */
   75     88   
                    }
          89  +
                    /* JsonParserGenerator.kt:695 */
   76     90   
                    other => {
   77     91   
                        return Err(
   78         -
                        ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   79         -
                            "expected object key or end object, found: {:?}",
   80         -
                            other
   81         -
                        )),
          92  +
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
          93  +
                                format!("expected object key or end object, found: {:?}", other),
          94  +
                            ),
   82     95   
                        )
          96  +
                    } /* JsonParserGenerator.kt:685 */
          97  +
                }
          98  +
                /* JsonParserGenerator.kt:684 */
   83     99   
            }
         100  +
            /* JsonParserGenerator.kt:568 */
   84    101   
        }
   85         -
        },
         102  +
        /* JsonParserGenerator.kt:642 */
   86    103   
        _ => {
   87    104   
            return Err(
   88    105   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   89    106   
                    "expected start object or null",
   90    107   
                ),
   91    108   
            )
         109  +
        } /* JsonParserGenerator.kt:567 */
   92    110   
    }
   93         -
    }
         111  +
    /* JsonParserGenerator.kt:649 */
   94    112   
    if variant.is_none() {
   95    113   
        return Err(
   96    114   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   97    115   
                "Union did not contain a valid variant.",
   98    116   
            ),
   99    117   
        );
  100    118   
    }
         119  +
    /* JsonParserGenerator.kt:657 */
  101    120   
    Ok(variant)
         121  +
    /* JsonParserGenerator.kt:551 */
  102    122   
}

tmp-codegen-diff/codegen-server-test/rest_json_validation/rust-server-codegen/src/protocol_serde/shape_greeting_struct.rs

@@ -1,1 +55,79 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* JsonParserGenerator.kt:516 */
    2      3   
pub(crate) fn de_greeting_struct<'a, I>(
    3      4   
    tokens: &mut ::std::iter::Peekable<I>,
    4      5   
) -> ::std::result::Result<
    5      6   
    Option<crate::model::GreetingStruct>,
    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  +
            /* RustType.kt:516 */
   19     23   
            #[allow(unused_mut)]
          24  +
            /* JsonParserGenerator.kt:526 */
   20     25   
            let mut builder = crate::model::greeting_struct::Builder::default();
          26  +
            /* JsonParserGenerator.kt:684 */
   21     27   
            loop {
          28  +
                /* JsonParserGenerator.kt:685 */
   22     29   
                match tokens.next().transpose()? {
          30  +
                    /* JsonParserGenerator.kt:686 */
   23     31   
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   24     32   
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
          33  +
                        /* JsonParserGenerator.kt:260 */
   25     34   
                        match key.to_unescaped()?.as_ref() {
          35  +
                            /* JsonParserGenerator.kt:262 */
   26     36   
                            "hi" => {
          37  +
                                /* JsonParserGenerator.kt:272 */
   27     38   
                                builder = builder.set_hi(
   28         -
                                    ::aws_smithy_json::deserialize::token::expect_string_or_null(
   29         -
                                        tokens.next(),
   30         -
                                    )?
   31         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   32         -
                                    .transpose()?,
   33         -
                                );
          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:272 */);
          45  +
                                /* JsonParserGenerator.kt:262 */
   34     46   
                            }
   35         -
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
          47  +
                            /* JsonParserGenerator.kt:290 */
          48  +
                            _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   36     49   
                        }
          50  +
                        /* JsonParserGenerator.kt:686 */
   37     51   
                    }
          52  +
                    /* JsonParserGenerator.kt:695 */
   38     53   
                    other => {
   39     54   
                        return Err(
   40     55   
                            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   41     56   
                                format!("expected object key or end object, found: {:?}", other),
   42     57   
                            ),
   43     58   
                        )
          59  +
                    } /* JsonParserGenerator.kt:685 */
   44     60   
                }
          61  +
                /* JsonParserGenerator.kt:684 */
   45     62   
            }
   46         -
            }
          63  +
            /* JsonParserGenerator.kt:540 */
   47     64   
            Ok(Some(builder.build()))
          65  +
            /* JsonParserGenerator.kt:713 */
   48     66   
        }
   49         -
        _ => Err(
          67  +
        /* JsonParserGenerator.kt:722 */
          68  +
        _ => {
          69  +
            /* JsonParserGenerator.kt:723 */
          70  +
            Err(
   50     71   
                ::aws_smithy_json::deserialize::error::DeserializeError::custom(
   51     72   
                    "expected start object or null",
   52     73   
                ),
   53         -
        ),
          74  +
            )
          75  +
            /* JsonParserGenerator.kt:722 */
          76  +
        } /* JsonParserGenerator.kt:712 */
   54     77   
    }
          78  +
    /* JsonParserGenerator.kt:516 */
   55     79   
}