Server Test

Server Test

rev. dfb5149b65b7bcc09edd15b8e071ad43b5ac5943 (ignoring whitespace)

Files changed:

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/lib.rs

@@ -1,1 +52,53 @@
   13     13   
#![allow(clippy::result_large_err)]
   14     14   
#![allow(clippy::unnecessary_map_on_constructor)]
   15     15   
#![allow(rustdoc::bare_urls)]
   16     16   
#![allow(rustdoc::redundant_explicit_links)]
   17     17   
#![allow(rustdoc::invalid_html_tags)]
   18     18   
#![forbid(unsafe_code)]
   19     19   
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
   20     20   
//! Confounds model generation machinery with lots of problematic names
   21     21   
   22     22   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
          23  +
/* ServerRootGenerator.kt:65 */
   23     24   
//! A fast and customizable Rust implementation of the Config Smithy service.
   24     25   
//!
   25     26   
//! # Using Config
   26     27   
//!
   27     28   
//! The primary entrypoint is [`Config`]: it satisfies the [`Service<http::Request, Response = http::Response>`](::tower::Service)
   28     29   
//! trait and therefore can be handed to a [`hyper` server](https://github.com/hyperium/hyper) via [`Config::into_make_service`]
   29     30   
//! or used in AWS Lambda
   30     31   
#![cfg_attr(
   31     32   
    feature = "aws-lambda",
   32     33   
    doc = " via [`LambdaHandler`](crate::server::routing::LambdaHandler)."
@@ -197,198 +272,280 @@
  217    218   
//! }
  218    219   
//!
  219    220   
//! ```
  220    221   
//!
  221    222   
//! [`serve`]: https://docs.rs/hyper/0.14.16/hyper/server/struct.Builder.html#method.serve
  222    223   
//! [`tower::make::MakeService`]: https://docs.rs/tower/latest/tower/make/trait.MakeService.html
  223    224   
//! [HTTP binding traits]: https://smithy.io/2.0/spec/http-bindings.html
  224    225   
//! [operations]: https://smithy.io/2.0/spec/service-types.html#operation
  225    226   
//! [hyper server]: https://docs.rs/hyper/latest/hyper/server/index.html
  226    227   
//! [Service]: https://docs.rs/tower-service/latest/tower_service/trait.Service.html
         228  +
/* ServerRootGenerator.kt:261 */
  227    229   
pub use crate::service::{
  228    230   
    Config, ConfigBuilder, ConfigConfig, ConfigConfigBuilder, MissingOperationsError,
  229    231   
};
  230    232   
  231         -
/// Contains the types that are re-exported from the `aws-smithy-http-server` crate.
         233  +
/// /* ServerRustModule.kt:55 */Contains the types that are re-exported from the `aws-smithy-http-server` crate.
  232    234   
pub mod server {
  233    235   
    // Re-export all types from the `aws-smithy-http-server` crate.
  234    236   
    pub use ::aws_smithy_http_server::*;
         237  +
         238  +
    /* CodegenDelegator.kt:200 */
  235    239   
}
  236    240   
         241  +
/* CrateVersionCustomization.kt:23 */
  237    242   
/// Crate version number.
  238    243   
pub static PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
  239    244   
  240         -
/// All error types that operations can return. Documentation on these types is copied from the model.
         245  +
/// /* ServerRustModule.kt:55 */All error types that operations can return. Documentation on these types is copied from the model.
  241    246   
pub mod error;
  242    247   
  243         -
/// Input structures for operations. Documentation on these types is copied from the model.
         248  +
/// /* ServerRustModule.kt:55 */Input structures for operations. Documentation on these types is copied from the model.
  244    249   
pub mod input;
  245    250   
  246         -
/// Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
         251  +
/// /* ServerRustModule.kt:55 */Data structures used by operation inputs/outputs. Documentation on these types is copied from the model.
  247    252   
pub mod model;
  248    253   
  249         -
/// All operations that this crate can perform.
         254  +
/// /* ServerRustModule.kt:55 */All operations that this crate can perform.
  250    255   
pub mod operation;
  251    256   
         257  +
/* ServerRustModule.kt:79 */
  252    258   
/// A collection of types representing each operation defined in the service closure.
  253    259   
///
  254    260   
/// The [plugin system](::aws_smithy_http_server::plugin) makes use of these
  255    261   
/// [zero-sized types](https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts) (ZSTs) to
  256    262   
/// parameterize [`Plugin`](::aws_smithy_http_server::plugin::Plugin) implementations. Their traits, such as
  257    263   
/// [`OperationShape`](::aws_smithy_http_server::operation::OperationShape), can be used to provide
  258    264   
/// operation specific information to the [`Layer`](::tower::Layer) being applied.
  259    265   
pub mod operation_shape;
  260    266   
  261         -
/// Output structures for operations. Documentation on these types is copied from the model.
         267  +
/// /* ServerRustModule.kt:55 */Output structures for operations. Documentation on these types is copied from the model.
  262    268   
pub mod output;
  263    269   
         270  +
/* RustModule.kt:172 */
  264    271   
mod service;
  265    272   
  266         -
/// Data primitives referenced by other data types.
         273  +
/// /* ServerRustModule.kt:55 */Data primitives referenced by other data types.
  267    274   
pub mod types;
  268    275   
  269         -
/// Constrained types for constrained shapes.
         276  +
/// /* ServerRustModule.kt:55 */Constrained types for constrained shapes.
         277  +
/* RustModule.kt:172 */
  270    278   
mod constrained;
  271    279   
  272    280   
pub(crate) mod protocol_serde;

tmp-codegen-diff/codegen-server-test/naming_test_ops/rust-server-codegen/src/model.rs

@@ -1,1 +277,405 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
    3         -
/// Describes one specific validation failure for an input member.
           2  +
/* StructureGenerator.kt:197 */
           3  +
/// /* StructureGenerator.kt:197 */Describes one specific validation failure for an input member.
           4  +
/* RustType.kt:516 */
    4      5   
#[derive(
    5      6   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
    6      7   
)]
    7         -
pub struct ValidationExceptionField {
    8         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
           8  +
pub /* StructureGenerator.kt:201 */ struct ValidationExceptionField {
           9  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
    9     10   
    pub path: ::std::string::String,
   10         -
    /// A detailed description of the validation failure.
          11  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
   11     12   
    pub message: ::std::string::String,
          13  +
    /* StructureGenerator.kt:201 */
   12     14   
}
          15  +
/* StructureGenerator.kt:135 */
   13     16   
impl ValidationExceptionField {
   14         -
    /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          17  +
    /// /* StructureGenerator.kt:231 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
          18  +
    /* StructureGenerator.kt:166 */
   15     19   
    pub fn path(&self) -> &str {
          20  +
        /* StructureGenerator.kt:171 */
   16     21   
        use std::ops::Deref;
   17     22   
        self.path.deref()
          23  +
        /* StructureGenerator.kt:166 */
   18     24   
    }
   19         -
    /// A detailed description of the validation failure.
          25  +
    /// /* StructureGenerator.kt:231 */A detailed description of the validation failure.
          26  +
    /* StructureGenerator.kt:166 */
   20     27   
    pub fn message(&self) -> &str {
          28  +
        /* StructureGenerator.kt:171 */
   21     29   
        use std::ops::Deref;
   22     30   
        self.message.deref()
          31  +
        /* StructureGenerator.kt:166 */
   23     32   
    }
          33  +
    /* StructureGenerator.kt:135 */
   24     34   
}
          35  +
/* ServerCodegenVisitor.kt:345 */
   25     36   
impl ValidationExceptionField {
   26         -
    /// Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          37  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ValidationExceptionField`](crate::model::ValidationExceptionField).
          38  +
    /* ServerBuilderGenerator.kt:295 */
   27     39   
    pub fn builder() -> crate::model::validation_exception_field::Builder {
          40  +
        /* ServerBuilderGenerator.kt:296 */
   28     41   
        crate::model::validation_exception_field::Builder::default()
          42  +
        /* ServerBuilderGenerator.kt:295 */
   29     43   
    }
          44  +
    /* ServerCodegenVisitor.kt:345 */
   30     45   
}
   31     46   
          47  +
/* EnumGenerator.kt:159 */
   32     48   
///
   33         -
/// _Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
          49  +
/// /* EnumGenerator.kt:160 */_Note: `UnknownVariantCollidingEnum::Self` has been renamed to `::SelfValue`.
   34     50   
/// `UnknownVariantCollidingEnum::SelfValue` has been renamed to `::SelfValue_`._
          51  +
/* RustType.kt:516 */
   35     52   
#[derive(
   36     53   
    ::std::clone::Clone,
   37     54   
    ::std::cmp::Eq,
   38     55   
    ::std::cmp::Ord,
   39     56   
    ::std::cmp::PartialEq,
   40     57   
    ::std::cmp::PartialOrd,
   41     58   
    ::std::fmt::Debug,
   42     59   
    ::std::hash::Hash,
   43     60   
)]
   44         -
pub enum UnknownVariantCollidingEnum {
          61  +
pub /* EnumGenerator.kt:267 */ enum UnknownVariantCollidingEnum {
          62  +
    /* EnumGenerator.kt:154 */
   45     63   
    #[allow(missing_docs)] // documentation missing in model
          64  +
    /* EnumGenerator.kt:143 */
   46     65   
    Known,
          66  +
    /* EnumGenerator.kt:159 */
   47     67   
    ///
   48         -
    /// _Note: `::Self` has been renamed to `::SelfValue`._
          68  +
    /// /* EnumGenerator.kt:160 */_Note: `::Self` has been renamed to `::SelfValue`._
          69  +
    /* EnumGenerator.kt:143 */
   49     70   
    SelfValue,
          71  +
    /* EnumGenerator.kt:159 */
   50     72   
    ///
   51         -
    /// _Note: `::SelfValue` has been renamed to `::SelfValue_`._
          73  +
    /// /* EnumGenerator.kt:160 */_Note: `::SelfValue` has been renamed to `::SelfValue_`._
          74  +
    /* EnumGenerator.kt:143 */
   52     75   
    SelfValue_,
          76  +
    /* EnumGenerator.kt:154 */
   53     77   
    #[allow(missing_docs)] // documentation missing in model
          78  +
    /* EnumGenerator.kt:143 */
   54     79   
    Unknown,
          80  +
    /* EnumGenerator.kt:154 */
   55     81   
    #[allow(missing_docs)] // documentation missing in model
          82  +
    /* EnumGenerator.kt:143 */
   56     83   
    UnknownValue,
          84  +
    /* EnumGenerator.kt:267 */
   57     85   
}
   58         -
/// See [`UnknownVariantCollidingEnum`](crate::model::UnknownVariantCollidingEnum).
          86  +
/// /* CodegenDelegator.kt:51 */See [`UnknownVariantCollidingEnum`](crate::model::UnknownVariantCollidingEnum).
   59     87   
pub mod unknown_variant_colliding_enum {
   60     88   
    #[derive(Debug, PartialEq)]
   61     89   
    pub struct ConstraintViolation(pub(crate) ::std::string::String);
   62     90   
   63     91   
    impl ::std::fmt::Display for ConstraintViolation {
   64     92   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
   65     93   
            write!(
   66     94   
                f,
   67     95   
                r#"Value provided for 'crate#UnknownVariantCollidingEnum' failed to satisfy constraint: Member must satisfy enum value set: [Known, Unknown, Self, UnknownValue, SelfValue]"#
   68     96   
            )
   69     97   
        }
   70     98   
    }
   71     99   
   72    100   
    impl ::std::error::Error for ConstraintViolation {}
   73    101   
    impl ConstraintViolation {
   74    102   
        pub(crate) fn as_validation_exception_field(
   75    103   
            self,
   76    104   
            path: ::std::string::String,
   77    105   
        ) -> crate::model::ValidationExceptionField {
   78    106   
            crate::model::ValidationExceptionField {
   79    107   
                message: format!(
   80    108   
                    r#"Value at '{}' failed to satisfy constraint: Member must satisfy enum value set: [Known, Unknown, Self, UnknownValue, SelfValue]"#,
   81    109   
                    &path
   82    110   
                ),
   83    111   
                path,
   84    112   
            }
   85    113   
        }
   86    114   
    }
         115  +
         116  +
    /* ServerEnumGenerator.kt:46 */
   87    117   
}
         118  +
/* ServerEnumGenerator.kt:85 */
   88    119   
impl ::std::convert::TryFrom<&str> for UnknownVariantCollidingEnum {
   89    120   
    type Error = crate::model::unknown_variant_colliding_enum::ConstraintViolation;
   90    121   
    fn try_from(
   91    122   
        s: &str,
   92    123   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<&str>>::Error> {
   93    124   
        match s {
   94    125   
            "Known" => Ok(UnknownVariantCollidingEnum::Known),
   95    126   
            "Self" => Ok(UnknownVariantCollidingEnum::SelfValue),
   96    127   
            "SelfValue" => Ok(UnknownVariantCollidingEnum::SelfValue_),
   97    128   
            "Unknown" => Ok(UnknownVariantCollidingEnum::Unknown),
   98    129   
            "UnknownValue" => Ok(UnknownVariantCollidingEnum::UnknownValue),
   99    130   
            _ => {
  100    131   
                Err(crate::model::unknown_variant_colliding_enum::ConstraintViolation(s.to_owned()))
  101    132   
            }
  102    133   
        }
  103    134   
    }
  104    135   
}
  105    136   
impl ::std::convert::TryFrom<::std::string::String> for UnknownVariantCollidingEnum {
  106    137   
    type Error = crate::model::unknown_variant_colliding_enum::ConstraintViolation;
  107    138   
    fn try_from(
  108    139   
        s: ::std::string::String,
  109    140   
    ) -> ::std::result::Result<Self, <Self as ::std::convert::TryFrom<::std::string::String>>::Error>
  110    141   
    {
  111    142   
        s.as_str().try_into()
  112    143   
    }
  113    144   
}
         145  +
/* ServerEnumGenerator.kt:145 */
  114    146   
impl std::str::FromStr for UnknownVariantCollidingEnum {
  115    147   
    type Err = crate::model::unknown_variant_colliding_enum::ConstraintViolation;
  116    148   
    fn from_str(s: &str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err> {
  117    149   
        Self::try_from(s)
  118    150   
    }
  119    151   
}
         152  +
/* EnumGenerator.kt:274 */
  120    153   
impl UnknownVariantCollidingEnum {
  121    154   
    /// Returns the `&str` value of the enum member.
  122    155   
    pub fn as_str(&self) -> &str {
  123    156   
        match self {
  124    157   
            UnknownVariantCollidingEnum::Known => "Known",
  125    158   
            UnknownVariantCollidingEnum::SelfValue => "Self",
  126    159   
            UnknownVariantCollidingEnum::SelfValue_ => "SelfValue",
  127    160   
            UnknownVariantCollidingEnum::Unknown => "Unknown",
  128    161   
            UnknownVariantCollidingEnum::UnknownValue => "UnknownValue",
  129    162   
        }
  130    163   
    }
  131    164   
    /// Returns all the `&str` representations of the enum members.
  132    165   
    pub const fn values() -> &'static [&'static str] {
  133    166   
        &["Known", "Self", "SelfValue", "Unknown", "UnknownValue"]
  134    167   
    }
  135    168   
}
         169  +
/* EnumGenerator.kt:223 */
  136    170   
impl ::std::convert::AsRef<str> for UnknownVariantCollidingEnum {
  137    171   
    fn as_ref(&self) -> &str {
  138    172   
        self.as_str()
  139    173   
    }
  140    174   
}
         175  +
/* ConstrainedTraitForEnumGenerator.kt:36 */
  141    176   
impl crate::constrained::Constrained for UnknownVariantCollidingEnum {
  142    177   
    type Unconstrained = ::std::string::String;
  143    178   
}
  144    179   
  145    180   
impl ::std::convert::From<::std::string::String>
  146    181   
    for crate::constrained::MaybeConstrained<crate::model::UnknownVariantCollidingEnum>
  147    182   
{
  148    183   
    fn from(value: ::std::string::String) -> Self {
  149    184   
        Self::Unconstrained(value)
  150    185   
    }
  151    186   
}
  152    187   
         188  +
/* StructureGenerator.kt:197 */
  153    189   
#[allow(missing_docs)] // documentation missing in model
         190  +
/* RustType.kt:516 */
  154    191   
#[derive(
  155    192   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
  156    193   
)]
  157         -
pub struct Vec {
         194  +
pub /* StructureGenerator.kt:201 */ struct Vec {
         195  +
    /* StructureGenerator.kt:231 */
  158    196   
    #[allow(missing_docs)] // documentation missing in model
  159    197   
    pub pv_member: ::std::option::Option<bool>,
         198  +
    /* StructureGenerator.kt:201 */
  160    199   
}
         200  +
/* StructureGenerator.kt:135 */
  161    201   
impl Vec {
         202  +
    /* StructureGenerator.kt:231 */
  162    203   
    #[allow(missing_docs)] // documentation missing in model
         204  +
                           /* StructureGenerator.kt:166 */
  163    205   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
         206  +
        /* StructureGenerator.kt:168 */
  164    207   
        self.pv_member
         208  +
        /* StructureGenerator.kt:166 */
  165    209   
    }
         210  +
    /* StructureGenerator.kt:135 */
  166    211   
}
         212  +
/* ServerCodegenVisitor.kt:345 */
  167    213   
impl Vec {
  168         -
    /// Creates a new builder-style object to manufacture [`Vec`](crate::model::Vec).
         214  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`Vec`](crate::model::Vec).
         215  +
    /* ServerBuilderGenerator.kt:295 */
  169    216   
    pub fn builder() -> crate::model::vec::Builder {
         217  +
        /* ServerBuilderGenerator.kt:296 */
  170    218   
        crate::model::vec::Builder::default()
         219  +
        /* ServerBuilderGenerator.kt:295 */
  171    220   
    }
         221  +
    /* ServerCodegenVisitor.kt:345 */
  172    222   
}
         223  +
/* ServerStructureConstrainedTraitImpl.kt:21 */
  173    224   
impl crate::constrained::Constrained for crate::model::Vec {
  174    225   
    type Unconstrained = crate::model::vec::Builder;
  175    226   
}
  176         -
/// See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         227  +
/// /* ServerBuilderGenerator.kt:171 */See [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  177    228   
pub mod validation_exception_field {
  178    229   
         230  +
    /* RustType.kt:516 */
  179    231   
    #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
  180         -
    /// Holds one variant for each of the ways the builder can fail.
         232  +
    /// /* ServerBuilderConstraintViolations.kt:72 */Holds one variant for each of the ways the builder can fail.
         233  +
    /* RustType.kt:516 */
  181    234   
    #[non_exhaustive]
         235  +
    /* ServerBuilderConstraintViolations.kt:75 */
  182    236   
    #[allow(clippy::enum_variant_names)]
  183    237   
    pub enum ConstraintViolation {
  184         -
        /// `path` was not provided but it is required when building `ValidationExceptionField`.
         238  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`path` was not provided but it is required when building `ValidationExceptionField`.
         239  +
        /* ServerBuilderConstraintViolations.kt:143 */
  185    240   
        MissingPath,
  186         -
        /// `message` was not provided but it is required when building `ValidationExceptionField`.
         241  +
        /// /* ServerBuilderConstraintViolations.kt:138 */`message` was not provided but it is required when building `ValidationExceptionField`.
         242  +
        /* ServerBuilderConstraintViolations.kt:143 */
  187    243   
        MissingMessage,
         244  +
        /* ServerBuilderConstraintViolations.kt:75 */
  188    245   
    }
         246  +
    /* ServerBuilderConstraintViolations.kt:117 */
  189    247   
    impl ::std::fmt::Display for ConstraintViolation {
         248  +
        /* ServerBuilderConstraintViolations.kt:118 */
  190    249   
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         250  +
            /* ServerBuilderConstraintViolations.kt:119 */
  191    251   
            match self {
  192         -
                ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
  193         -
                ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
  194         -
            }
         252  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingPath => write!(f, "`path` was not provided but it is required when building `ValidationExceptionField`"),
         253  +
                /* ServerBuilderConstraintViolations.kt:127 */ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationExceptionField`"),
         254  +
            /* ServerBuilderConstraintViolations.kt:119 */}
         255  +
            /* ServerBuilderConstraintViolations.kt:118 */
  195    256   
        }
         257  +
        /* ServerBuilderConstraintViolations.kt:117 */
  196    258   
    }
         259  +
    /* ServerBuilderConstraintViolations.kt:84 */
  197    260   
    impl ::std::error::Error for ConstraintViolation {}
         261  +
    /* ServerBuilderGenerator.kt:446 */
  198    262   
    impl ::std::convert::TryFrom<Builder> for crate::model::ValidationExceptionField {
  199    263   
        type Error = ConstraintViolation;
  200    264   
  201    265   
        fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
  202    266   
            builder.build()
  203    267   
        }
  204    268   
    }
  205         -
    /// A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         269  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         270  +
    /* RustType.kt:516 */
  206    271   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         272  +
    /* ServerBuilderGenerator.kt:211 */
  207    273   
    pub struct Builder {
         274  +
        /* ServerBuilderGenerator.kt:308 */
  208    275   
        pub(crate) path: ::std::option::Option<::std::string::String>,
         276  +
        /* ServerBuilderGenerator.kt:308 */
  209    277   
        pub(crate) message: ::std::option::Option<::std::string::String>,
         278  +
        /* ServerBuilderGenerator.kt:211 */
  210    279   
    }
         280  +
    /* ServerBuilderGenerator.kt:215 */
  211    281   
    impl Builder {
  212         -
        /// A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         282  +
        /// /* ServerBuilderGenerator.kt:331 */A JSONPointer expression to the structure member whose value failed to satisfy the modeled constraints.
         283  +
        /* ServerBuilderGenerator.kt:343 */
  213    284   
        pub fn path(mut self, input: ::std::string::String) -> Self {
  214         -
            self.path = Some(input);
         285  +
            /* ServerBuilderGenerator.kt:344 */
         286  +
            self.path =
         287  +
                /* ServerBuilderGenerator.kt:345 */Some(
         288  +
                    /* ServerBuilderGenerator.kt:376 */input
         289  +
                /* ServerBuilderGenerator.kt:345 */)
         290  +
            /* ServerBuilderGenerator.kt:344 */;
  215    291   
            self
         292  +
            /* ServerBuilderGenerator.kt:343 */
  216    293   
        }
  217         -
        /// A detailed description of the validation failure.
         294  +
        /// /* ServerBuilderGenerator.kt:331 */A detailed description of the validation failure.
         295  +
        /* ServerBuilderGenerator.kt:343 */
  218    296   
        pub fn message(mut self, input: ::std::string::String) -> Self {
  219         -
            self.message = Some(input);
         297  +
            /* ServerBuilderGenerator.kt:344 */
         298  +
            self.message =
         299  +
                /* ServerBuilderGenerator.kt:345 */Some(
         300  +
                    /* ServerBuilderGenerator.kt:376 */input
         301  +
                /* ServerBuilderGenerator.kt:345 */)
         302  +
            /* ServerBuilderGenerator.kt:344 */;
  220    303   
            self
         304  +
            /* ServerBuilderGenerator.kt:343 */
  221    305   
        }
  222         -
        /// Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
  223         -
        ///
         306  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ValidationExceptionField`](crate::model::ValidationExceptionField).
         307  +
        /// /* ServerBuilderGenerator.kt:260 */
  224    308   
        /// The builder fails to construct a [`ValidationExceptionField`](crate::model::ValidationExceptionField) if a [`ConstraintViolation`] occurs.
  225    309   
        ///
  226         -
        /// If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         310  +
        /// /* ServerBuilderGenerator.kt:268 */If the builder fails, it will return the _first_ encountered [`ConstraintViolation`].
         311  +
        /* ServerBuilderGenerator.kt:271 */
  227    312   
        pub fn build(self) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  228    313   
            self.build_enforcing_all_constraints()
  229    314   
        }
         315  +
        /* ServerBuilderGenerator.kt:283 */
  230    316   
        fn build_enforcing_all_constraints(
  231    317   
            self,
  232    318   
        ) -> Result<crate::model::ValidationExceptionField, ConstraintViolation> {
  233         -
            Ok(crate::model::ValidationExceptionField {
  234         -
                path: self.path.ok_or(ConstraintViolation::MissingPath)?,
  235         -
                message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
  236         -
            })
         319  +
            /* ServerBuilderGenerator.kt:287 */
         320  +
            Ok(
         321  +
                /* ServerBuilderGenerator.kt:542 */
         322  +
                crate::model::ValidationExceptionField {
         323  +
                    /* ServerBuilderGenerator.kt:546 */
         324  +
                    path: self
         325  +
                        .path
         326  +
                        /* ServerBuilderGenerator.kt:569 */
         327  +
                        .ok_or(ConstraintViolation::MissingPath)?,
         328  +
                    /* ServerBuilderGenerator.kt:546 */
         329  +
                    message: self
         330  +
                        .message
         331  +
                        /* ServerBuilderGenerator.kt:569 */
         332  +
                        .ok_or(ConstraintViolation::MissingMessage)?,
         333  +
                    /* ServerBuilderGenerator.kt:542 */
         334  +
                }, /* ServerBuilderGenerator.kt:287 */
         335  +
            )
         336  +
            /* ServerBuilderGenerator.kt:283 */
  237    337   
        }
         338  +
        /* ServerBuilderGenerator.kt:215 */
  238    339   
    }
         340  +
         341  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  239    342   
}
  240         -
/// See [`Vec`](crate::model::Vec).
         343  +
/// /* ServerBuilderGenerator.kt:171 */See [`Vec`](crate::model::Vec).
  241    344   
pub mod vec {
  242    345   
         346  +
    /* ServerBuilderGenerator.kt:461 */
  243    347   
    impl ::std::convert::From<Builder> for crate::model::Vec {
  244    348   
        fn from(builder: Builder) -> Self {
  245    349   
            builder.build()
  246    350   
        }
  247    351   
    }
  248         -
    /// A builder for [`Vec`](crate::model::Vec).
         352  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`Vec`](crate::model::Vec).
         353  +
    /* RustType.kt:516 */
  249    354   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         355  +
    /* ServerBuilderGenerator.kt:211 */
  250    356   
    pub struct Builder {
         357  +
        /* ServerBuilderGenerator.kt:308 */
  251    358   
        pub(crate) pv_member: ::std::option::Option<bool>,
         359  +
        /* ServerBuilderGenerator.kt:211 */
  252    360   
    }
         361  +
    /* ServerBuilderGenerator.kt:215 */
  253    362   
    impl Builder {
         363  +
        /* ServerBuilderGenerator.kt:331 */
  254    364   
        #[allow(missing_docs)] // documentation missing in model
         365  +
                               /* ServerBuilderGenerator.kt:343 */
  255    366   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  256         -
            self.pv_member = input;
         367  +
            /* ServerBuilderGenerator.kt:344 */
         368  +
            self.pv_member =
         369  +
                /* ServerBuilderGenerator.kt:376 */input
         370  +
            /* ServerBuilderGenerator.kt:344 */;
  257    371   
            self
         372  +
            /* ServerBuilderGenerator.kt:343 */
  258    373   
        }
         374  +
        /* ServerBuilderGenerator.kt:426 */
  259    375   
        #[allow(missing_docs)] // documentation missing in model
         376  +
                               /* ServerBuilderGenerator.kt:428 */
  260    377   
        pub(crate) fn set_pv_member(
  261    378   
            mut self,
  262    379   
            input: Option<impl ::std::convert::Into<bool>>,
  263    380   
        ) -> Self {
         381  +
            /* ServerBuilderGenerator.kt:429 */
  264    382   
            self.pv_member = input.map(|v| v.into());
  265    383   
            self
         384  +
            /* ServerBuilderGenerator.kt:428 */
  266    385   
        }
  267         -
        /// Consumes the builder and constructs a [`Vec`](crate::model::Vec).
         386  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`Vec`](crate::model::Vec).
         387  +
        /* ServerBuilderGenerator.kt:271 */
  268    388   
        pub fn build(self) -> crate::model::Vec {
  269    389   
            self.build_enforcing_all_constraints()
  270    390   
        }
         391  +
        /* ServerBuilderGenerator.kt:283 */
  271    392   
        fn build_enforcing_all_constraints(self) -> crate::model::Vec {
         393  +
            /* ServerBuilderGenerator.kt:542 */
  272    394   
            crate::model::Vec {
         395  +
                /* ServerBuilderGenerator.kt:546 */
  273    396   
                pv_member: self.pv_member,
         397  +
                /* ServerBuilderGenerator.kt:542 */
  274    398   
            }
         399  +
            /* ServerBuilderGenerator.kt:283 */
  275    400   
        }
         401  +
        /* ServerBuilderGenerator.kt:215 */
  276    402   
    }
         403  +
         404  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  277    405   
}

tmp-codegen-diff/codegen-server-test/naming_test_ops/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   
static CONTENT_TYPE_RPCECHO: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
    3      4   
    "application/x-amz-json-1.1"
    4      5   
        .parse::<::mime::Mime>()
    5      6   
        .expect("BUG: MIME parsing failed, content_type is not valid")
    6      7   
});
    7      8   
::pin_project_lite::pin_project! {
    8      9   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
    9     10   
    /// [`RpcEchoInput`](crate::input::RpcEchoInput) using modelled bindings.
   10     11   
    pub struct RpcEchoInputFuture {
   11     12   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::RpcEchoInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -40,41 +147,151 @@
   60     61   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
   61     62   
                ::tracing::debug!(error = %e, "failed to deserialize request");
   62     63   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
   63     64   
            },
   64     65   
        );
   65     66   
        RpcEchoInputFuture {
   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::aws_json_11::AwsJson1_1,
   73     75   
    > for crate::output::RpcEchoOutput
   74     76   
{
   75     77   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   76     78   
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_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::<
   81     83   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
   82     84   
                >::into_response(
   83     85   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
   84     86   
                        e,
   85     87   
                    ),
   86     88   
                )
   87     89   
            }
   88     90   
        }
   89     91   
    }
   90     92   
}
          93  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
   91     94   
impl
   92     95   
    ::aws_smithy_http_server::response::IntoResponse<
   93     96   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
   94     97   
    > for crate::error::RPCEchoError
   95     98   
{
   96     99   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
   97    100   
        match crate::protocol_serde::shape_rpc_echo::ser_rpc_echo_http_error(&self) {
   98    101   
            Ok(mut response) => {
   99    102   
                response.extensions_mut().insert(
  100    103   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  101    104   
                );
  102    105   
                response
  103    106   
            }
  104    107   
            Err(e) => {
  105    108   
                ::tracing::error!(error = %e, "failed to serialize response");
  106    109   
                ::aws_smithy_http_server::response::IntoResponse::<
  107    110   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  108    111   
                >::into_response(
  109    112   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  110    113   
                        e,
  111    114   
                    ),
  112    115   
                )
  113    116   
            }
  114    117   
        }
  115    118   
    }
  116    119   
}
  117    120   
         121  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  118    122   
static CONTENT_TYPE_MATCH: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  119    123   
    "application/x-amz-json-1.1"
  120    124   
        .parse::<::mime::Mime>()
  121    125   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  122    126   
});
  123    127   
::pin_project_lite::pin_project! {
  124    128   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  125    129   
    /// [`MatchInput`](crate::input::MatchInput) using modelled bindings.
  126    130   
    pub struct MatchInputFuture {
  127    131   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::MatchInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -156,160 +263,270 @@
  176    180   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  177    181   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  178    182   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  179    183   
            },
  180    184   
        );
  181    185   
        MatchInputFuture {
  182    186   
            inner: Box::pin(fut),
  183    187   
        }
  184    188   
    }
  185    189   
}
         190  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  186    191   
impl
  187    192   
    ::aws_smithy_http_server::response::IntoResponse<
  188    193   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  189    194   
    > for crate::output::MatchOutput
  190    195   
{
  191    196   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  192    197   
        match crate::protocol_serde::shape_match::ser_match_http_response(self) {
  193    198   
            Ok(response) => response,
  194    199   
            Err(e) => {
  195    200   
                ::tracing::error!(error = %e, "failed to serialize response");
  196    201   
                ::aws_smithy_http_server::response::IntoResponse::<
  197    202   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  198    203   
                >::into_response(
  199    204   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  200    205   
                        e,
  201    206   
                    ),
  202    207   
                )
  203    208   
            }
  204    209   
        }
  205    210   
    }
  206    211   
}
         212  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  207    213   
impl
  208    214   
    ::aws_smithy_http_server::response::IntoResponse<
  209    215   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  210    216   
    > for crate::error::MatchError
  211    217   
{
  212    218   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  213    219   
        match crate::protocol_serde::shape_match::ser_match_http_error(&self) {
  214    220   
            Ok(mut response) => {
  215    221   
                response.extensions_mut().insert(
  216    222   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  217    223   
                );
  218    224   
                response
  219    225   
            }
  220    226   
            Err(e) => {
  221    227   
                ::tracing::error!(error = %e, "failed to serialize response");
  222    228   
                ::aws_smithy_http_server::response::IntoResponse::<
  223    229   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  224    230   
                >::into_response(
  225    231   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  226    232   
                        e,
  227    233   
                    ),
  228    234   
                )
  229    235   
            }
  230    236   
        }
  231    237   
    }
  232    238   
}
  233    239   
         240  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  234    241   
static CONTENT_TYPE_OPTION: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  235    242   
    "application/x-amz-json-1.1"
  236    243   
        .parse::<::mime::Mime>()
  237    244   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  238    245   
});
  239    246   
::pin_project_lite::pin_project! {
  240    247   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  241    248   
    /// [`OptionInput`](crate::input::OptionInput) using modelled bindings.
  242    249   
    pub struct OptionInputFuture {
  243    250   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::OptionInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -272,279 +353,362 @@
  292    299   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  293    300   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  294    301   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  295    302   
            },
  296    303   
        );
  297    304   
        OptionInputFuture {
  298    305   
            inner: Box::pin(fut),
  299    306   
        }
  300    307   
    }
  301    308   
}
         309  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  302    310   
impl
  303    311   
    ::aws_smithy_http_server::response::IntoResponse<
  304    312   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  305    313   
    > for crate::output::OptionOutput
  306    314   
{
  307    315   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  308    316   
        match crate::protocol_serde::shape_option::ser_option_http_response(self) {
  309    317   
            Ok(response) => response,
  310    318   
            Err(e) => {
  311    319   
                ::tracing::error!(error = %e, "failed to serialize response");
  312    320   
                ::aws_smithy_http_server::response::IntoResponse::<
  313    321   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  314    322   
                >::into_response(
  315    323   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  316    324   
                        e,
  317    325   
                    ),
  318    326   
                )
  319    327   
            }
  320    328   
        }
  321    329   
    }
  322    330   
}
  323    331   
         332  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  324    333   
static CONTENT_TYPE_RESULT: std::sync::LazyLock<::mime::Mime> = std::sync::LazyLock::new(|| {
  325    334   
    "application/x-amz-json-1.1"
  326    335   
        .parse::<::mime::Mime>()
  327    336   
        .expect("BUG: MIME parsing failed, content_type is not valid")
  328    337   
});
  329    338   
::pin_project_lite::pin_project! {
  330    339   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  331    340   
    /// [`ResultInput`](crate::input::ResultInput) using modelled bindings.
  332    341   
    pub struct ResultInputFuture {
  333    342   
        inner: std::pin::Pin<Box<dyn std::future::Future<Output = Result<crate::input::ResultInput, ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError>> + Send>>
@@ -362,371 +443,454 @@
  382    391   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  383    392   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  384    393   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  385    394   
            },
  386    395   
        );
  387    396   
        ResultInputFuture {
  388    397   
            inner: Box::pin(fut),
  389    398   
        }
  390    399   
    }
  391    400   
}
         401  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  392    402   
impl
  393    403   
    ::aws_smithy_http_server::response::IntoResponse<
  394    404   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  395    405   
    > for crate::output::ResultOutput
  396    406   
{
  397    407   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  398    408   
        match crate::protocol_serde::shape_result::ser_result_http_response(self) {
  399    409   
            Ok(response) => response,
  400    410   
            Err(e) => {
  401    411   
                ::tracing::error!(error = %e, "failed to serialize response");
  402    412   
                ::aws_smithy_http_server::response::IntoResponse::<
  403    413   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  404    414   
                >::into_response(
  405    415   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  406    416   
                        e,
  407    417   
                    ),
  408    418   
                )
  409    419   
            }
  410    420   
        }
  411    421   
    }
  412    422   
}
  413    423   
         424  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  414    425   
static CONTENT_TYPE_ERRCOLLISIONS: std::sync::LazyLock<::mime::Mime> =
  415    426   
    std::sync::LazyLock::new(|| {
  416    427   
        "application/x-amz-json-1.1"
  417    428   
            .parse::<::mime::Mime>()
  418    429   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  419    430   
    });
  420    431   
::pin_project_lite::pin_project! {
  421    432   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  422    433   
    /// [`ErrCollisionsInput`](crate::input::ErrCollisionsInput) using modelled bindings.
  423    434   
    pub struct ErrCollisionsInputFuture {
@@ -453,464 +560,574 @@
  473    484   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  474    485   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  475    486   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  476    487   
            },
  477    488   
        );
  478    489   
        ErrCollisionsInputFuture {
  479    490   
            inner: Box::pin(fut),
  480    491   
        }
  481    492   
    }
  482    493   
}
         494  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  483    495   
impl
  484    496   
    ::aws_smithy_http_server::response::IntoResponse<
  485    497   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  486    498   
    > for crate::output::ErrCollisionsOutput
  487    499   
{
  488    500   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  489    501   
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_response(self) {
  490    502   
            Ok(response) => response,
  491    503   
            Err(e) => {
  492    504   
                ::tracing::error!(error = %e, "failed to serialize response");
  493    505   
                ::aws_smithy_http_server::response::IntoResponse::<
  494    506   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  495    507   
                >::into_response(
  496    508   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  497    509   
                        e,
  498    510   
                    ),
  499    511   
                )
  500    512   
            }
  501    513   
        }
  502    514   
    }
  503    515   
}
         516  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  504    517   
impl
  505    518   
    ::aws_smithy_http_server::response::IntoResponse<
  506    519   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  507    520   
    > for crate::error::ErrCollisionsError
  508    521   
{
  509    522   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  510    523   
        match crate::protocol_serde::shape_err_collisions::ser_err_collisions_http_error(&self) {
  511    524   
            Ok(mut response) => {
  512    525   
                response.extensions_mut().insert(
  513    526   
                    ::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()),
  514    527   
                );
  515    528   
                response
  516    529   
            }
  517    530   
            Err(e) => {
  518    531   
                ::tracing::error!(error = %e, "failed to serialize response");
  519    532   
                ::aws_smithy_http_server::response::IntoResponse::<
  520    533   
                    ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  521    534   
                >::into_response(
  522    535   
                    ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(
  523    536   
                        e,
  524    537   
                    ),
  525    538   
                )
  526    539   
            }
  527    540   
        }
  528    541   
    }
  529    542   
}
  530    543   
         544  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  531    545   
static CONTENT_TYPE_STRUCTURENAMEPUNNING: std::sync::LazyLock<::mime::Mime> =
  532    546   
    std::sync::LazyLock::new(|| {
  533    547   
        "application/x-amz-json-1.1"
  534    548   
            .parse::<::mime::Mime>()
  535    549   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  536    550   
    });
  537    551   
::pin_project_lite::pin_project! {
  538    552   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  539    553   
    /// [`StructureNamePunningInput`](crate::input::StructureNamePunningInput) using modelled bindings.
  540    554   
    pub struct StructureNamePunningInputFuture {
@@ -570,584 +697,718 @@
  590    604   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  591    605   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  592    606   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  593    607   
            },
  594    608   
        );
  595    609   
        StructureNamePunningInputFuture {
  596    610   
            inner: Box::pin(fut),
  597    611   
        }
  598    612   
    }
  599    613   
}
         614  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  600    615   
impl
  601    616   
    ::aws_smithy_http_server::response::IntoResponse<
  602    617   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  603    618   
    > for crate::output::StructureNamePunningOutput
  604    619   
{
  605    620   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  606    621   
        match crate::protocol_serde::shape_structure_name_punning::ser_structure_name_punning_http_response(self) {
  607    622   
                        Ok(response) => response,
  608    623   
                        Err(e) => {
  609    624   
                            ::tracing::error!(error = %e, "failed to serialize response");
  610    625   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  611    626   
                        }
  612    627   
                    }
  613    628   
    }
  614    629   
}
  615    630   
         631  +
/* RustType.kt:516 */
  616    632   
#[allow(unreachable_code, unused_variables)]
         633  +
/* RustType.kt:516 */
  617    634   
#[cfg(test)]
         635  +
/* ProtocolTestGenerator.kt:98 */
  618    636   
mod structure_name_punning_test {
  619    637   
  620    638   
    /// Test ID: structure_punning
  621    639   
    #[::tokio::test]
  622    640   
    #[::tracing_test::traced_test]
  623    641   
    async fn structure_punning_request() {
  624    642   
        #[allow(unused_mut)]
  625    643   
        let mut http_request = http::Request::builder()
  626    644   
            .uri("/")
  627    645   
            .method("POST")
  628    646   
            .header("Content-Type", "application/x-amz-json-1.1")
  629    647   
            .header("X-Amz-Target", "Config.StructureNamePunning")
  630    648   
            .body(::aws_smithy_http_server::body::Body::from(
  631    649   
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  632    650   
                    "{\"regular_string\": \"hello!\"}".as_bytes(),
  633    651   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  634    652   
                )),
  635    653   
            ))
  636    654   
            .unwrap();
  637    655   
        #[allow(unused_mut)]
  638    656   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  639    657   
        let config = crate::service::ConfigConfig::builder().build();
  640    658   
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
  641    659   
            .structure_name_punning(move |input: crate::input::StructureNamePunningInput| {
  642    660   
                let sender = sender.clone();
  643    661   
                async move {
  644    662   
                    let result = {
  645    663   
                        let expected = crate::input::StructureNamePunningInput {
  646    664   
                            regular_string: ::std::option::Option::Some("hello!".to_owned()),
  647    665   
                            punned_vec: ::std::option::Option::None,
  648    666   
                        };
  649    667   
                        ::pretty_assertions::assert_eq!(input, expected);
  650    668   
                        let output = crate::output::StructureNamePunningOutput {};
  651    669   
                        output
  652    670   
                    };
  653    671   
                    sender.send(()).await.expect("receiver dropped early");
  654    672   
                    result
  655    673   
                }
  656    674   
            })
  657    675   
            .build_unchecked();
  658    676   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  659    677   
            .await
  660    678   
            .expect("unable to make an HTTP request");
  661    679   
        assert!(
  662    680   
            receiver.recv().await.is_some(),
  663    681   
            "we expected operation handler to be invoked but it was not entered"
  664    682   
        );
  665    683   
    }
         684  +
         685  +
    /* ProtocolTestGenerator.kt:98 */
  666    686   
}
  667    687   
         688  +
/* ServerHttpBoundProtocolGenerator.kt:266 */
  668    689   
static CONTENT_TYPE_RESERVEDWORDSASMEMBERS: std::sync::LazyLock<::mime::Mime> =
  669    690   
    std::sync::LazyLock::new(|| {
  670    691   
        "application/x-amz-json-1.1"
  671    692   
            .parse::<::mime::Mime>()
  672    693   
            .expect("BUG: MIME parsing failed, content_type is not valid")
  673    694   
    });
  674    695   
::pin_project_lite::pin_project! {
  675    696   
    /// A [`Future`](std::future::Future) aggregating the body bytes of a [`Request`] and constructing the
  676    697   
    /// [`ReservedWordsAsMembersInput`](crate::input::ReservedWordsAsMembersInput) using modelled bindings.
  677    698   
    pub struct ReservedWordsAsMembersInputFuture {
@@ -707,728 +828,856 @@
  727    748   
            |e: ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection| {
  728    749   
                ::tracing::debug!(error = %e, "failed to deserialize request");
  729    750   
                ::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e)
  730    751   
            },
  731    752   
        );
  732    753   
        ReservedWordsAsMembersInputFuture {
  733    754   
            inner: Box::pin(fut),
  734    755   
        }
  735    756   
    }
  736    757   
}
         758  +
/* ServerHttpBoundProtocolGenerator.kt:329 */
  737    759   
impl
  738    760   
    ::aws_smithy_http_server::response::IntoResponse<
  739    761   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  740    762   
    > for crate::output::ReservedWordsAsMembersOutput
  741    763   
{
  742    764   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  743    765   
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_response(self) {
  744    766   
                        Ok(response) => response,
  745    767   
                        Err(e) => {
  746    768   
                            ::tracing::error!(error = %e, "failed to serialize response");
  747    769   
                            ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  748    770   
                        }
  749    771   
                    }
  750    772   
    }
  751    773   
}
         774  +
/* ServerHttpBoundProtocolGenerator.kt:350 */
  752    775   
impl
  753    776   
    ::aws_smithy_http_server::response::IntoResponse<
  754    777   
        ::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1,
  755    778   
    > for crate::error::ReservedWordsAsMembersError
  756    779   
{
  757    780   
    fn into_response(self) -> ::aws_smithy_http_server::response::Response {
  758    781   
        match crate::protocol_serde::shape_reserved_words_as_members::ser_reserved_words_as_members_http_error(&self) {
  759    782   
            Ok(mut response) => {
  760    783   
                response.extensions_mut().insert(::aws_smithy_http_server::extension::ModeledErrorExtension::new(self.name()));
  761    784   
                response
  762    785   
            },
  763    786   
            Err(e) => {
  764    787   
                ::tracing::error!(error = %e, "failed to serialize response");
  765    788   
                ::aws_smithy_http_server::response::IntoResponse::<::aws_smithy_http_server::protocol::aws_json_11::AwsJson1_1>::into_response(::aws_smithy_http_server::protocol::aws_json::runtime_error::RuntimeError::from(e))
  766    789   
            }
  767    790   
        }
  768    791   
    }
  769    792   
}
  770    793   
         794  +
/* RustType.kt:516 */
  771    795   
#[allow(unreachable_code, unused_variables)]
         796  +
/* RustType.kt:516 */
  772    797   
#[cfg(test)]
         798  +
/* ProtocolTestGenerator.kt:98 */
  773    799   
mod reserved_words_as_members_test {
  774    800   
  775    801   
    /// Test ID: reserved_words
  776    802   
    #[::tokio::test]
  777    803   
    #[::tracing_test::traced_test]
  778    804   
    async fn reserved_words_request() {
  779    805   
        #[allow(unused_mut)]
  780    806   
        let mut http_request = http::Request::builder()
  781    807   
            .uri("/")
  782    808   
            .method("POST")
  783    809   
            .header("Content-Type", "application/x-amz-json-1.1")
  784    810   
            .header("X-Amz-Target", "Config.ReservedWordsAsMembers")
  785    811   
            .body(::aws_smithy_http_server::body::Body::from(
  786    812   
                ::bytes::Bytes::copy_from_slice(&::aws_smithy_protocol_test::decode_body_data(
  787    813   
                    "{\"as\": 5, \"async\": true}".as_bytes(),
  788    814   
                    ::aws_smithy_protocol_test::MediaType::from("application/json"),
  789    815   
                )),
  790    816   
            ))
  791    817   
            .unwrap();
  792    818   
        #[allow(unused_mut)]
  793    819   
        let (sender, mut receiver) = ::tokio::sync::mpsc::channel(1);
  794    820   
        let config = crate::service::ConfigConfig::builder().build();
  795    821   
        let service = crate::service::Config::builder::<::hyper::body::Body, _, _, _>(config)
  796    822   
            .reserved_words_as_members(move |input: crate::input::ReservedWordsAsMembersInput| {
  797    823   
                let sender = sender.clone();
  798    824   
                async move {
  799    825   
                    let result = {
  800    826   
                        let expected = crate::input::ReservedWordsAsMembersInput {
  801    827   
                            r#as: ::std::option::Option::Some(5),
  802    828   
                            r#async: ::std::option::Option::Some(true),
  803    829   
                            r#enum: ::std::option::Option::None,
  804    830   
                            self_: ::std::option::Option::None,
  805    831   
                            crate_: ::std::option::Option::None,
  806    832   
                            super_: ::std::option::Option::None,
  807    833   
                            build_value: ::std::option::Option::None,
  808    834   
                            default_value: ::std::option::Option::None,
  809    835   
                            send: ::std::option::Option::None,
  810    836   
                        };
  811    837   
                        ::pretty_assertions::assert_eq!(input, expected);
  812    838   
                        let output = crate::output::ReservedWordsAsMembersOutput {};
  813    839   
                        Ok(output)
  814    840   
                    };
  815    841   
                    sender.send(()).await.expect("receiver dropped early");
  816    842   
                    result
  817    843   
                }
  818    844   
            })
  819    845   
            .build_unchecked();
  820    846   
        let http_response = ::tower::ServiceExt::oneshot(service, http_request)
  821    847   
            .await
  822    848   
            .expect("unable to make an HTTP request");
  823    849   
        assert!(
  824    850   
            receiver.recv().await.is_some(),
  825    851   
            "we expected operation handler to be invoked but it was not entered"
  826    852   
        );
  827    853   
    }
         854  +
         855  +
    /* ProtocolTestGenerator.kt:98 */
  828    856   
}

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

@@ -1,1 +0,210 @@
    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 RpcEcho;
    4      6   
    5      7   
impl ::aws_smithy_http_server::operation::OperationShape for RpcEcho {
    6      8   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
    7      9   
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#RPCEcho", "crate", "RPCEcho");
    8     10   
    9     11   
    type Input = crate::input::RpcEchoInput;
   10     12   
    type Output = crate::output::RpcEchoOutput;
   11     13   
    type Error = crate::error::RPCEchoError;
   12     14   
}
   13     15   
   14     16   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for RpcEcho {
   15     17   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   16     18   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   17     19   
   18     20   
    fn request_fmt() -> Self::RequestFmt {
   19     21   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   20     22   
    }
   21     23   
   22     24   
    fn response_fmt() -> Self::ResponseFmt {
   23     25   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   24     26   
    }
   25     27   
}
          28  +
/* ServerOperationGenerator.kt:88 */
   26     29   
          30  +
/* ServerOperationGenerator.kt:48 */
   27     31   
#[allow(missing_docs)] // documentation missing in model
          32  +
                       /* ServerOperationGenerator.kt:55 */
   28     33   
pub struct Match;
   29     34   
   30     35   
impl ::aws_smithy_http_server::operation::OperationShape for Match {
   31     36   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   32     37   
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Match", "crate", "Match");
   33     38   
   34     39   
    type Input = crate::input::MatchInput;
   35     40   
    type Output = crate::output::MatchOutput;
   36     41   
    type Error = crate::error::MatchError;
   37     42   
}
   38     43   
   39     44   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Match {
   40     45   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   41     46   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   42     47   
   43     48   
    fn request_fmt() -> Self::RequestFmt {
   44     49   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   45     50   
    }
   46     51   
   47     52   
    fn response_fmt() -> Self::ResponseFmt {
   48     53   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   49     54   
    }
   50     55   
}
          56  +
/* ServerOperationGenerator.kt:88 */
   51     57   
          58  +
/* ServerOperationGenerator.kt:48 */
   52     59   
#[allow(missing_docs)] // documentation missing in model
          60  +
                       /* ServerOperationGenerator.kt:55 */
   53     61   
pub struct Option;
   54     62   
   55     63   
impl ::aws_smithy_http_server::operation::OperationShape for Option {
   56     64   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   57     65   
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Option", "crate", "Option");
   58     66   
   59     67   
    type Input = crate::input::OptionInput;
   60     68   
    type Output = crate::output::OptionOutput;
   61     69   
    type Error = std::convert::Infallible;
   62     70   
}
   63     71   
   64     72   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Option {
   65     73   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   66     74   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   67     75   
   68     76   
    fn request_fmt() -> Self::RequestFmt {
   69     77   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   70     78   
    }
   71     79   
   72     80   
    fn response_fmt() -> Self::ResponseFmt {
   73     81   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   74     82   
    }
   75     83   
}
          84  +
/* ServerOperationGenerator.kt:88 */
   76     85   
          86  +
/* ServerOperationGenerator.kt:48 */
   77     87   
#[allow(missing_docs)] // documentation missing in model
          88  +
                       /* ServerOperationGenerator.kt:55 */
   78     89   
pub struct Result;
   79     90   
   80     91   
impl ::aws_smithy_http_server::operation::OperationShape for Result {
   81     92   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
   82     93   
        ::aws_smithy_http_server::shape_id::ShapeId::new("crate#Result", "crate", "Result");
   83     94   
   84     95   
    type Input = crate::input::ResultInput;
   85     96   
    type Output = crate::output::ResultOutput;
   86     97   
    type Error = std::convert::Infallible;
   87     98   
}
   88     99   
   89    100   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for Result {
   90    101   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
   91    102   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
   92    103   
   93    104   
    fn request_fmt() -> Self::RequestFmt {
   94    105   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
   95    106   
    }
   96    107   
   97    108   
    fn response_fmt() -> Self::ResponseFmt {
   98    109   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
   99    110   
    }
  100    111   
}
         112  +
/* ServerOperationGenerator.kt:88 */
  101    113   
         114  +
/* ServerOperationGenerator.kt:48 */
  102    115   
#[allow(missing_docs)] // documentation missing in model
         116  +
                       /* ServerOperationGenerator.kt:55 */
  103    117   
pub struct ErrCollisions;
  104    118   
  105    119   
impl ::aws_smithy_http_server::operation::OperationShape for ErrCollisions {
  106    120   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  107    121   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  108    122   
            "crate#ErrCollisions",
  109    123   
            "crate",
  110    124   
            "ErrCollisions",
  111    125   
        );
  112    126   
  113    127   
    type Input = crate::input::ErrCollisionsInput;
  114    128   
    type Output = crate::output::ErrCollisionsOutput;
  115    129   
    type Error = crate::error::ErrCollisionsError;
  116    130   
}
  117    131   
  118    132   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for ErrCollisions {
  119    133   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  120    134   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  121    135   
  122    136   
    fn request_fmt() -> Self::RequestFmt {
  123    137   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  124    138   
    }
  125    139   
  126    140   
    fn response_fmt() -> Self::ResponseFmt {
  127    141   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  128    142   
    }
  129    143   
}
         144  +
/* ServerOperationGenerator.kt:88 */
  130    145   
         146  +
/* ServerOperationGenerator.kt:48 */
  131    147   
#[allow(missing_docs)] // documentation missing in model
         148  +
                       /* ServerOperationGenerator.kt:55 */
  132    149   
pub struct StructureNamePunning;
  133    150   
  134    151   
impl ::aws_smithy_http_server::operation::OperationShape for StructureNamePunning {
  135    152   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  136    153   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  137    154   
            "crate#StructureNamePunning",
  138    155   
            "crate",
  139    156   
            "StructureNamePunning",
  140    157   
        );
  141    158   
  142    159   
    type Input = crate::input::StructureNamePunningInput;
  143    160   
    type Output = crate::output::StructureNamePunningOutput;
  144    161   
    type Error = std::convert::Infallible;
  145    162   
}
  146    163   
  147    164   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity for StructureNamePunning {
  148    165   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  149    166   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  150    167   
  151    168   
    fn request_fmt() -> Self::RequestFmt {
  152    169   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  153    170   
    }
  154    171   
  155    172   
    fn response_fmt() -> Self::ResponseFmt {
  156    173   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  157    174   
    }
  158    175   
}
         176  +
/* ServerOperationGenerator.kt:88 */
  159    177   
         178  +
/* ServerOperationGenerator.kt:48 */
  160    179   
#[allow(missing_docs)] // documentation missing in model
         180  +
                       /* ServerOperationGenerator.kt:55 */
  161    181   
pub struct ReservedWordsAsMembers;
  162    182   
  163    183   
impl ::aws_smithy_http_server::operation::OperationShape for ReservedWordsAsMembers {
  164    184   
    const ID: ::aws_smithy_http_server::shape_id::ShapeId =
  165    185   
        ::aws_smithy_http_server::shape_id::ShapeId::new(
  166    186   
            "crate#ReservedWordsAsMembers",
  167    187   
            "crate",
  168    188   
            "ReservedWordsAsMembers",
  169    189   
        );
  170    190   
  171    191   
    type Input = crate::input::ReservedWordsAsMembersInput;
  172    192   
    type Output = crate::output::ReservedWordsAsMembersOutput;
  173    193   
    type Error = crate::error::ReservedWordsAsMembersError;
  174    194   
}
  175    195   
  176    196   
impl ::aws_smithy_http_server::instrumentation::sensitivity::Sensitivity
  177    197   
    for ReservedWordsAsMembers
  178    198   
{
  179    199   
    type RequestFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultRequestFmt;
  180    200   
    type ResponseFmt = ::aws_smithy_http_server::instrumentation::sensitivity::DefaultResponseFmt;
  181    201   
  182    202   
    fn request_fmt() -> Self::RequestFmt {
  183    203   
        ::aws_smithy_http_server::instrumentation::sensitivity::RequestFmt::new()
  184    204   
    }
  185    205   
  186    206   
    fn response_fmt() -> Self::ResponseFmt {
  187    207   
        ::aws_smithy_http_server::instrumentation::sensitivity::ResponseFmt::new()
  188    208   
    }
  189    209   
}
         210  +
/* ServerOperationGenerator.kt:88 */

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

@@ -1,1 +249,399 @@
    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 RpcEchoOutput {}
           8  +
pub /* StructureGenerator.kt:201 */ struct RpcEchoOutput {/* StructureGenerator.kt:201 */}
           9  +
/* ServerCodegenVisitor.kt:345 */
    7     10   
impl RpcEchoOutput {
    8         -
    /// Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
          11  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`RpcEchoOutput`](crate::output::RpcEchoOutput).
          12  +
    /* ServerBuilderGenerator.kt:295 */
    9     13   
    pub fn builder() -> crate::output::rpc_echo_output::Builder {
          14  +
        /* ServerBuilderGenerator.kt:296 */
   10     15   
        crate::output::rpc_echo_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 MatchOutput {}
          27  +
pub /* StructureGenerator.kt:201 */ struct MatchOutput {/* StructureGenerator.kt:201 */}
          28  +
/* ServerCodegenVisitor.kt:345 */
   19     29   
impl MatchOutput {
   20         -
    /// Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
          30  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`MatchOutput`](crate::output::MatchOutput).
          31  +
    /* ServerBuilderGenerator.kt:295 */
   21     32   
    pub fn builder() -> crate::output::match_output::Builder {
          33  +
        /* ServerBuilderGenerator.kt:296 */
   22     34   
        crate::output::match_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 OptionOutput {}
          46  +
pub /* StructureGenerator.kt:201 */ struct OptionOutput {/* StructureGenerator.kt:201 */}
          47  +
/* ServerCodegenVisitor.kt:345 */
   31     48   
impl OptionOutput {
   32         -
    /// Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
          49  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`OptionOutput`](crate::output::OptionOutput).
          50  +
    /* ServerBuilderGenerator.kt:295 */
   33     51   
    pub fn builder() -> crate::output::option_output::Builder {
          52  +
        /* ServerBuilderGenerator.kt:296 */
   34     53   
        crate::output::option_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 ResultOutput {
          65  +
pub /* StructureGenerator.kt:201 */ struct ResultOutput {
          66  +
    /* StructureGenerator.kt:231 */
   43     67   
    #[allow(missing_docs)] // documentation missing in model
   44     68   
    pub pv_member: ::std::option::Option<bool>,
          69  +
    /* StructureGenerator.kt:201 */
   45     70   
}
          71  +
/* StructureGenerator.kt:135 */
   46     72   
impl ResultOutput {
          73  +
    /* StructureGenerator.kt:231 */
   47     74   
    #[allow(missing_docs)] // documentation missing in model
          75  +
                           /* StructureGenerator.kt:166 */
   48     76   
    pub fn pv_member(&self) -> ::std::option::Option<bool> {
          77  +
        /* StructureGenerator.kt:168 */
   49     78   
        self.pv_member
          79  +
        /* StructureGenerator.kt:166 */
   50     80   
    }
          81  +
    /* StructureGenerator.kt:135 */
   51     82   
}
          83  +
/* ServerCodegenVisitor.kt:345 */
   52     84   
impl ResultOutput {
   53         -
    /// Creates a new builder-style object to manufacture [`ResultOutput`](crate::output::ResultOutput).
          85  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ResultOutput`](crate::output::ResultOutput).
          86  +
    /* ServerBuilderGenerator.kt:295 */
   54     87   
    pub fn builder() -> crate::output::result_output::Builder {
          88  +
        /* ServerBuilderGenerator.kt:296 */
   55     89   
        crate::output::result_output::Builder::default()
          90  +
        /* ServerBuilderGenerator.kt:295 */
   56     91   
    }
          92  +
    /* ServerCodegenVisitor.kt:345 */
   57     93   
}
   58     94   
          95  +
/* StructureGenerator.kt:197 */
   59     96   
#[allow(missing_docs)] // documentation missing in model
          97  +
/* RustType.kt:516 */
   60     98   
#[derive(
   61     99   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   62    100   
)]
   63         -
pub struct ErrCollisionsOutput {}
         101  +
pub /* StructureGenerator.kt:201 */ struct ErrCollisionsOutput {/* StructureGenerator.kt:201 */}
         102  +
/* ServerCodegenVisitor.kt:345 */
   64    103   
impl ErrCollisionsOutput {
   65         -
    /// Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         104  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         105  +
    /* ServerBuilderGenerator.kt:295 */
   66    106   
    pub fn builder() -> crate::output::err_collisions_output::Builder {
         107  +
        /* ServerBuilderGenerator.kt:296 */
   67    108   
        crate::output::err_collisions_output::Builder::default()
         109  +
        /* ServerBuilderGenerator.kt:295 */
   68    110   
    }
         111  +
    /* ServerCodegenVisitor.kt:345 */
   69    112   
}
   70    113   
         114  +
/* StructureGenerator.kt:197 */
   71    115   
#[allow(missing_docs)] // documentation missing in model
         116  +
/* RustType.kt:516 */
   72    117   
#[derive(
   73    118   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   74    119   
)]
   75         -
pub struct StructureNamePunningOutput {}
         120  +
pub /* StructureGenerator.kt:201 */ struct StructureNamePunningOutput {/* StructureGenerator.kt:201 */}
         121  +
/* ServerCodegenVisitor.kt:345 */
   76    122   
impl StructureNamePunningOutput {
   77         -
    /// Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         123  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         124  +
    /* ServerBuilderGenerator.kt:295 */
   78    125   
    pub fn builder() -> crate::output::structure_name_punning_output::Builder {
         126  +
        /* ServerBuilderGenerator.kt:296 */
   79    127   
        crate::output::structure_name_punning_output::Builder::default()
         128  +
        /* ServerBuilderGenerator.kt:295 */
   80    129   
    }
         130  +
    /* ServerCodegenVisitor.kt:345 */
   81    131   
}
   82    132   
         133  +
/* StructureGenerator.kt:197 */
   83    134   
#[allow(missing_docs)] // documentation missing in model
         135  +
/* RustType.kt:516 */
   84    136   
#[derive(
   85    137   
    ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
   86    138   
)]
   87         -
pub struct ReservedWordsAsMembersOutput {}
         139  +
pub /* StructureGenerator.kt:201 */ struct ReservedWordsAsMembersOutput {/* StructureGenerator.kt:201 */}
         140  +
/* ServerCodegenVisitor.kt:345 */
   88    141   
impl ReservedWordsAsMembersOutput {
   89         -
    /// Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         142  +
    /// /* ServerBuilderGenerator.kt:294 */Creates a new builder-style object to manufacture [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         143  +
    /* ServerBuilderGenerator.kt:295 */
   90    144   
    pub fn builder() -> crate::output::reserved_words_as_members_output::Builder {
         145  +
        /* ServerBuilderGenerator.kt:296 */
   91    146   
        crate::output::reserved_words_as_members_output::Builder::default()
         147  +
        /* ServerBuilderGenerator.kt:295 */
   92    148   
    }
         149  +
    /* ServerCodegenVisitor.kt:345 */
   93    150   
}
   94         -
/// See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         151  +
/// /* ServerBuilderGenerator.kt:171 */See [`RpcEchoOutput`](crate::output::RpcEchoOutput).
   95    152   
pub mod rpc_echo_output {
   96    153   
         154  +
    /* ServerBuilderGenerator.kt:461 */
   97    155   
    impl ::std::convert::From<Builder> for crate::output::RpcEchoOutput {
   98    156   
        fn from(builder: Builder) -> Self {
   99    157   
            builder.build()
  100    158   
        }
  101    159   
    }
  102         -
    /// A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         160  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         161  +
    /* RustType.kt:516 */
  103    162   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  104         -
    pub struct Builder {}
         163  +
    /* ServerBuilderGenerator.kt:211 */
         164  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         165  +
    /* ServerBuilderGenerator.kt:215 */
  105    166   
    impl Builder {
  106         -
        /// Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         167  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`RpcEchoOutput`](crate::output::RpcEchoOutput).
         168  +
        /* ServerBuilderGenerator.kt:271 */
  107    169   
        pub fn build(self) -> crate::output::RpcEchoOutput {
  108    170   
            self.build_enforcing_all_constraints()
  109    171   
        }
         172  +
        /* ServerBuilderGenerator.kt:283 */
  110    173   
        fn build_enforcing_all_constraints(self) -> crate::output::RpcEchoOutput {
  111         -
            crate::output::RpcEchoOutput {}
         174  +
            /* ServerBuilderGenerator.kt:542 */
         175  +
            crate::output::RpcEchoOutput {
         176  +
            /* ServerBuilderGenerator.kt:542 */}
         177  +
            /* ServerBuilderGenerator.kt:283 */
  112    178   
        }
         179  +
        /* ServerBuilderGenerator.kt:215 */
  113    180   
    }
         181  +
         182  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  114    183   
}
  115         -
/// See [`MatchOutput`](crate::output::MatchOutput).
         184  +
/// /* ServerBuilderGenerator.kt:171 */See [`MatchOutput`](crate::output::MatchOutput).
  116    185   
pub mod match_output {
  117    186   
         187  +
    /* ServerBuilderGenerator.kt:461 */
  118    188   
    impl ::std::convert::From<Builder> for crate::output::MatchOutput {
  119    189   
        fn from(builder: Builder) -> Self {
  120    190   
            builder.build()
  121    191   
        }
  122    192   
    }
  123         -
    /// A builder for [`MatchOutput`](crate::output::MatchOutput).
         193  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`MatchOutput`](crate::output::MatchOutput).
         194  +
    /* RustType.kt:516 */
  124    195   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  125         -
    pub struct Builder {}
         196  +
    /* ServerBuilderGenerator.kt:211 */
         197  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         198  +
    /* ServerBuilderGenerator.kt:215 */
  126    199   
    impl Builder {
  127         -
        /// Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         200  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`MatchOutput`](crate::output::MatchOutput).
         201  +
        /* ServerBuilderGenerator.kt:271 */
  128    202   
        pub fn build(self) -> crate::output::MatchOutput {
  129    203   
            self.build_enforcing_all_constraints()
  130    204   
        }
         205  +
        /* ServerBuilderGenerator.kt:283 */
  131    206   
        fn build_enforcing_all_constraints(self) -> crate::output::MatchOutput {
  132         -
            crate::output::MatchOutput {}
         207  +
            /* ServerBuilderGenerator.kt:542 */
         208  +
            crate::output::MatchOutput {
         209  +
            /* ServerBuilderGenerator.kt:542 */}
         210  +
            /* ServerBuilderGenerator.kt:283 */
  133    211   
        }
         212  +
        /* ServerBuilderGenerator.kt:215 */
  134    213   
    }
         214  +
         215  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  135    216   
}
  136         -
/// See [`OptionOutput`](crate::output::OptionOutput).
         217  +
/// /* ServerBuilderGenerator.kt:171 */See [`OptionOutput`](crate::output::OptionOutput).
  137    218   
pub mod option_output {
  138    219   
         220  +
    /* ServerBuilderGenerator.kt:461 */
  139    221   
    impl ::std::convert::From<Builder> for crate::output::OptionOutput {
  140    222   
        fn from(builder: Builder) -> Self {
  141    223   
            builder.build()
  142    224   
        }
  143    225   
    }
  144         -
    /// A builder for [`OptionOutput`](crate::output::OptionOutput).
         226  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`OptionOutput`](crate::output::OptionOutput).
         227  +
    /* RustType.kt:516 */
  145    228   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  146         -
    pub struct Builder {}
         229  +
    /* ServerBuilderGenerator.kt:211 */
         230  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         231  +
    /* ServerBuilderGenerator.kt:215 */
  147    232   
    impl Builder {
  148         -
        /// Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         233  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`OptionOutput`](crate::output::OptionOutput).
         234  +
        /* ServerBuilderGenerator.kt:271 */
  149    235   
        pub fn build(self) -> crate::output::OptionOutput {
  150    236   
            self.build_enforcing_all_constraints()
  151    237   
        }
         238  +
        /* ServerBuilderGenerator.kt:283 */
  152    239   
        fn build_enforcing_all_constraints(self) -> crate::output::OptionOutput {
  153         -
            crate::output::OptionOutput {}
         240  +
            /* ServerBuilderGenerator.kt:542 */
         241  +
            crate::output::OptionOutput {
         242  +
            /* ServerBuilderGenerator.kt:542 */}
         243  +
            /* ServerBuilderGenerator.kt:283 */
  154    244   
        }
         245  +
        /* ServerBuilderGenerator.kt:215 */
  155    246   
    }
         247  +
         248  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  156    249   
}
  157         -
/// See [`ResultOutput`](crate::output::ResultOutput).
         250  +
/// /* ServerBuilderGenerator.kt:171 */See [`ResultOutput`](crate::output::ResultOutput).
  158    251   
pub mod result_output {
  159    252   
         253  +
    /* ServerBuilderGenerator.kt:461 */
  160    254   
    impl ::std::convert::From<Builder> for crate::output::ResultOutput {
  161    255   
        fn from(builder: Builder) -> Self {
  162    256   
            builder.build()
  163    257   
        }
  164    258   
    }
  165         -
    /// A builder for [`ResultOutput`](crate::output::ResultOutput).
         259  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ResultOutput`](crate::output::ResultOutput).
         260  +
    /* RustType.kt:516 */
  166    261   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
         262  +
    /* ServerBuilderGenerator.kt:211 */
  167    263   
    pub struct Builder {
         264  +
        /* ServerBuilderGenerator.kt:308 */
  168    265   
        pub(crate) pv_member: ::std::option::Option<bool>,
         266  +
        /* ServerBuilderGenerator.kt:211 */
  169    267   
    }
         268  +
    /* ServerBuilderGenerator.kt:215 */
  170    269   
    impl Builder {
         270  +
        /* ServerBuilderGenerator.kt:331 */
  171    271   
        #[allow(missing_docs)] // documentation missing in model
         272  +
                               /* ServerBuilderGenerator.kt:343 */
  172    273   
        pub fn pv_member(mut self, input: ::std::option::Option<bool>) -> Self {
  173         -
            self.pv_member = input;
         274  +
            /* ServerBuilderGenerator.kt:344 */
         275  +
            self.pv_member =
         276  +
                /* ServerBuilderGenerator.kt:376 */input
         277  +
            /* ServerBuilderGenerator.kt:344 */;
  174    278   
            self
         279  +
            /* ServerBuilderGenerator.kt:343 */
  175    280   
        }
  176         -
        /// Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
         281  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ResultOutput`](crate::output::ResultOutput).
         282  +
        /* ServerBuilderGenerator.kt:271 */
  177    283   
        pub fn build(self) -> crate::output::ResultOutput {
  178    284   
            self.build_enforcing_all_constraints()
  179    285   
        }
         286  +
        /* ServerBuilderGenerator.kt:283 */
  180    287   
        fn build_enforcing_all_constraints(self) -> crate::output::ResultOutput {
         288  +
            /* ServerBuilderGenerator.kt:542 */
  181    289   
            crate::output::ResultOutput {
         290  +
                /* ServerBuilderGenerator.kt:546 */
  182    291   
                pv_member: self.pv_member,
         292  +
                /* ServerBuilderGenerator.kt:542 */
  183    293   
            }
         294  +
            /* ServerBuilderGenerator.kt:283 */
  184    295   
        }
         296  +
        /* ServerBuilderGenerator.kt:215 */
  185    297   
    }
         298  +
         299  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  186    300   
}
  187         -
/// See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         301  +
/// /* ServerBuilderGenerator.kt:171 */See [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
  188    302   
pub mod err_collisions_output {
  189    303   
         304  +
    /* ServerBuilderGenerator.kt:461 */
  190    305   
    impl ::std::convert::From<Builder> for crate::output::ErrCollisionsOutput {
  191    306   
        fn from(builder: Builder) -> Self {
  192    307   
            builder.build()
  193    308   
        }
  194    309   
    }
  195         -
    /// A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         310  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         311  +
    /* RustType.kt:516 */
  196    312   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  197         -
    pub struct Builder {}
         313  +
    /* ServerBuilderGenerator.kt:211 */
         314  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         315  +
    /* ServerBuilderGenerator.kt:215 */
  198    316   
    impl Builder {
  199         -
        /// Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         317  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ErrCollisionsOutput`](crate::output::ErrCollisionsOutput).
         318  +
        /* ServerBuilderGenerator.kt:271 */
  200    319   
        pub fn build(self) -> crate::output::ErrCollisionsOutput {
  201    320   
            self.build_enforcing_all_constraints()
  202    321   
        }
         322  +
        /* ServerBuilderGenerator.kt:283 */
  203    323   
        fn build_enforcing_all_constraints(self) -> crate::output::ErrCollisionsOutput {
  204         -
            crate::output::ErrCollisionsOutput {}
         324  +
            /* ServerBuilderGenerator.kt:542 */
         325  +
            crate::output::ErrCollisionsOutput {
         326  +
            /* ServerBuilderGenerator.kt:542 */}
         327  +
            /* ServerBuilderGenerator.kt:283 */
  205    328   
        }
         329  +
        /* ServerBuilderGenerator.kt:215 */
  206    330   
    }
         331  +
         332  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  207    333   
}
  208         -
/// See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         334  +
/// /* ServerBuilderGenerator.kt:171 */See [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
  209    335   
pub mod structure_name_punning_output {
  210    336   
         337  +
    /* ServerBuilderGenerator.kt:461 */
  211    338   
    impl ::std::convert::From<Builder> for crate::output::StructureNamePunningOutput {
  212    339   
        fn from(builder: Builder) -> Self {
  213    340   
            builder.build()
  214    341   
        }
  215    342   
    }
  216         -
    /// A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         343  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         344  +
    /* RustType.kt:516 */
  217    345   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  218         -
    pub struct Builder {}
         346  +
    /* ServerBuilderGenerator.kt:211 */
         347  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         348  +
    /* ServerBuilderGenerator.kt:215 */
  219    349   
    impl Builder {
  220         -
        /// Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         350  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`StructureNamePunningOutput`](crate::output::StructureNamePunningOutput).
         351  +
        /* ServerBuilderGenerator.kt:271 */
  221    352   
        pub fn build(self) -> crate::output::StructureNamePunningOutput {
  222    353   
            self.build_enforcing_all_constraints()
  223    354   
        }
         355  +
        /* ServerBuilderGenerator.kt:283 */
  224    356   
        fn build_enforcing_all_constraints(self) -> crate::output::StructureNamePunningOutput {
  225         -
            crate::output::StructureNamePunningOutput {}
         357  +
            /* ServerBuilderGenerator.kt:542 */
         358  +
            crate::output::StructureNamePunningOutput {
         359  +
            /* ServerBuilderGenerator.kt:542 */}
         360  +
            /* ServerBuilderGenerator.kt:283 */
  226    361   
        }
         362  +
        /* ServerBuilderGenerator.kt:215 */
  227    363   
    }
         364  +
         365  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  228    366   
}
  229         -
/// See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         367  +
/// /* ServerBuilderGenerator.kt:171 */See [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
  230    368   
pub mod reserved_words_as_members_output {
  231    369   
         370  +
    /* ServerBuilderGenerator.kt:461 */
  232    371   
    impl ::std::convert::From<Builder> for crate::output::ReservedWordsAsMembersOutput {
  233    372   
        fn from(builder: Builder) -> Self {
  234    373   
            builder.build()
  235    374   
        }
  236    375   
    }
  237         -
    /// A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         376  +
    /// /* ServerBuilderGenerator.kt:201 */A builder for [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         377  +
    /* RustType.kt:516 */
  238    378   
    #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
  239         -
    pub struct Builder {}
         379  +
    /* ServerBuilderGenerator.kt:211 */
         380  +
    pub struct Builder {/* ServerBuilderGenerator.kt:211 */}
         381  +
    /* ServerBuilderGenerator.kt:215 */
  240    382   
    impl Builder {
  241         -
        /// Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         383  +
        /// /* ServerBuilderGenerator.kt:258 */Consumes the builder and constructs a [`ReservedWordsAsMembersOutput`](crate::output::ReservedWordsAsMembersOutput).
         384  +
        /* ServerBuilderGenerator.kt:271 */
  242    385   
        pub fn build(self) -> crate::output::ReservedWordsAsMembersOutput {
  243    386   
            self.build_enforcing_all_constraints()
  244    387   
        }
         388  +
        /* ServerBuilderGenerator.kt:283 */
  245    389   
        fn build_enforcing_all_constraints(self) -> crate::output::ReservedWordsAsMembersOutput {
  246         -
            crate::output::ReservedWordsAsMembersOutput {}
         390  +
            /* ServerBuilderGenerator.kt:542 */
         391  +
            crate::output::ReservedWordsAsMembersOutput {
         392  +
            /* ServerBuilderGenerator.kt:542 */}
         393  +
            /* ServerBuilderGenerator.kt:283 */
  247    394   
        }
         395  +
        /* ServerBuilderGenerator.kt:215 */
  248    396   
    }
         397  +
         398  +
    /* RustCrateInlineModuleComposingWriter.kt:299 */
  249    399   
}

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

@@ -1,1 +36,37 @@
   10     10   
pub(crate) mod shape_result;
   11     11   
   12     12   
pub(crate) mod shape_rpc_echo;
   13     13   
   14     14   
pub(crate) mod shape_structure_name_punning;
   15     15   
   16     16   
pub(crate) mod shape_colliding_error;
   17     17   
   18     18   
pub(crate) mod shape_colliding_exception;
   19     19   
          20  +
/* JsonParserGenerator.kt:227 */
   20     21   
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   21     22   
    if data.is_empty() {
   22     23   
        b"{}"
   23     24   
    } else {
   24     25   
        data
   25     26   
    }
   26     27   
}
   27     28   
   28     29   
pub(crate) mod shape_option_output;
   29     30   

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

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

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

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

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

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

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

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

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

@@ -1,1 +109,156 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_option_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::OptionInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::option_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_option::de_option(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_option_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::OptionOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_option_output::ser_option_output_output_output(&output)?;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_option_output::ser_option_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   53     77   
        let content_length = payload.len();
   54     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     79   
            builder,
   56     80   
            ::http::header::CONTENT_LENGTH,
   57     81   
            content_length,
   58     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   59     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   60     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   61     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   62     90   
}
   63     91   
          92  +
/* JsonParserGenerator.kt:148 */
   64     93   
pub(crate) fn de_option(
   65     94   
    value: &[u8],
   66     95   
    mut builder: crate::input::option_input::Builder,
   67     96   
) -> ::std::result::Result<
   68     97   
    crate::input::option_input::Builder,
   69     98   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   70     99   
> {
         100  +
    /* JsonParserGenerator.kt:153 */
   71    101   
    let mut tokens_owned =
   72    102   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   73    103   
            .peekable();
   74    104   
    let tokens = &mut tokens_owned;
   75    105   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         106  +
    /* JsonParserGenerator.kt:684 */
   76    107   
    loop {
         108  +
        /* JsonParserGenerator.kt:685 */
   77    109   
        match tokens.next().transpose()? {
         110  +
            /* JsonParserGenerator.kt:686 */
   78    111   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   79    112   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         113  +
                /* JsonParserGenerator.kt:260 */
   80    114   
                match key.to_unescaped()?.as_ref() {
         115  +
                    /* JsonParserGenerator.kt:262 */
   81    116   
                    "pv_member" => {
         117  +
                        /* JsonParserGenerator.kt:272 */
   82    118   
                        builder = builder.set_pv_member(
         119  +
                            /* JsonParserGenerator.kt:298 */
   83    120   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   84    121   
                                tokens.next(),
   85         -
                            )?,
         122  +
                            )?, /* JsonParserGenerator.kt:272 */
   86    123   
                        );
         124  +
                        /* JsonParserGenerator.kt:262 */
   87    125   
                    }
   88         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         126  +
                    /* JsonParserGenerator.kt:290 */
         127  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   89    128   
                }
         129  +
                /* JsonParserGenerator.kt:686 */
   90    130   
            }
         131  +
            /* JsonParserGenerator.kt:695 */
   91    132   
            other => {
   92    133   
                return Err(
   93    134   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   94    135   
                        "expected object key or end object, found: {:?}",
   95    136   
                        other
   96    137   
                    )),
   97    138   
                )
         139  +
            } /* JsonParserGenerator.kt:685 */
   98    140   
        }
         141  +
        /* JsonParserGenerator.kt:684 */
   99    142   
    }
  100         -
    }
         143  +
    /* JsonParserGenerator.kt:250 */
  101    144   
    if tokens.next().is_some() {
         145  +
        /* JsonParserGenerator.kt:251 */
  102    146   
        return Err(
  103    147   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  104    148   
                "found more JSON tokens after completing parsing",
  105    149   
            ),
  106    150   
        );
         151  +
        /* JsonParserGenerator.kt:250 */
  107    152   
    }
         153  +
    /* JsonParserGenerator.kt:163 */
  108    154   
    Ok(builder)
         155  +
    /* JsonParserGenerator.kt:148 */
  109    156   
}

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

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

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

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

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

@@ -1,1 +109,156 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/* RustType.kt:516 */
    2      3   
#[allow(clippy::unnecessary_wraps)]
           4  +
/* ServerHttpBoundProtocolGenerator.kt:383 */
    3      5   
pub async fn de_result_http_request<B>(
    4      6   
    #[allow(unused_variables)] request: ::http::Request<B>,
    5      7   
) -> std::result::Result<
    6      8   
    crate::input::ResultInput,
    7      9   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection,
    8     10   
>
    9     11   
where
   10     12   
    B: ::aws_smithy_http_server::body::HttpBody + Send,
   11     13   
    B::Data: Send,
   12     14   
    ::aws_smithy_http_server::protocol::aws_json::rejection::RequestRejection:
   13     15   
        From<<B as ::aws_smithy_http_server::body::HttpBody>::Error>,
   14     16   
{
          17  +
    /* ServerHttpBoundProtocolGenerator.kt:399 */
   15     18   
    Ok({
          19  +
        /* RustType.kt:516 */
   16     20   
        #[allow(unused_mut)]
          21  +
        /* ServerHttpBoundProtocolGenerator.kt:723 */
   17     22   
        let mut input = crate::input::result_input::Builder::default();
          23  +
        /* RustType.kt:516 */
   18     24   
        #[allow(unused_variables)]
          25  +
        /* ServerHttpBoundProtocolGenerator.kt:728 */
   19     26   
        let ::aws_smithy_runtime_api::http::RequestParts {
   20     27   
            uri, headers, body, ..
   21     28   
        } = ::aws_smithy_runtime_api::http::Request::try_from(request)?.into_parts();
          29  +
        /* ServerHttpBoundProtocolGenerator.kt:745 */
   22     30   
        let bytes = ::hyper::body::to_bytes(body).await?;
          31  +
        /* ServerHttpBoundProtocolGenerator.kt:768 */
   23     32   
        if !bytes.is_empty() {
          33  +
            /* ServerHttpBoundProtocolGenerator.kt:769 */
   24     34   
            ::aws_smithy_http_server::protocol::content_type_header_classifier_smithy(
   25     35   
                &headers,
   26     36   
                Some("application/x-amz-json-1.1"),
   27     37   
            )?;
   28     38   
            input = crate::protocol_serde::shape_result::de_result(bytes.as_ref(), input)?;
          39  +
            /* ServerHttpBoundProtocolGenerator.kt:768 */
   29     40   
        }
          41  +
        /* ServerHttpBoundProtocolGenerator.kt:834 */
   30     42   
        input.build()
          43  +
        /* ServerHttpBoundProtocolGenerator.kt:399 */
   31     44   
    })
          45  +
    /* ServerHttpBoundProtocolGenerator.kt:383 */
   32     46   
}
   33     47   
          48  +
/* RustType.kt:516 */
   34     49   
#[allow(clippy::unnecessary_wraps)]
          50  +
/* ServerHttpBoundProtocolGenerator.kt:421 */
   35     51   
pub fn ser_result_http_response(
   36     52   
    #[allow(unused_variables)] output: crate::output::ResultOutput,
   37     53   
) -> std::result::Result<
   38     54   
    ::aws_smithy_http_server::response::Response,
   39     55   
    ::aws_smithy_http_server::protocol::aws_json::rejection::ResponseRejection,
   40     56   
> {
          57  +
    /* ServerHttpBoundProtocolGenerator.kt:433 */
   41     58   
    Ok({
          59  +
        /* RustType.kt:516 */
   42     60   
        #[allow(unused_mut)]
          61  +
        /* ServerHttpBoundProtocolGenerator.kt:523 */
   43     62   
        let mut builder = ::http::Response::builder();
          63  +
        /* ServerHttpBoundProtocolGenerator.kt:597 */
   44     64   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   45     65   
            builder,
   46     66   
            ::http::header::CONTENT_TYPE,
   47     67   
            "application/x-amz-json-1.1",
   48     68   
        );
          69  +
        /* ServerHttpBoundProtocolGenerator.kt:682 */
   49     70   
        let http_status: u16 = 200;
   50     71   
        builder = builder.status(http_status);
          72  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */
   51     73   
        let payload =
   52         -
            crate::protocol_serde::shape_result_output::ser_result_output_output_output(&output)?;
          74  +
            /* HttpBoundProtocolPayloadGenerator.kt:237 */crate::protocol_serde::shape_result_output::ser_result_output_output_output(&output)?
          75  +
        /* ServerHttpBoundProtocolGenerator.kt:561 */;
          76  +
        /* ServerHttpBoundProtocolGenerator.kt:663 */
   53     77   
        let content_length = payload.len();
   54     78   
        builder = ::aws_smithy_http::header::set_response_header_if_absent(
   55     79   
            builder,
   56     80   
            ::http::header::CONTENT_LENGTH,
   57     81   
            content_length,
   58     82   
        );
          83  +
        /* ServerHttpBoundProtocolGenerator.kt:567 */
   59     84   
        let body = ::aws_smithy_http_server::body::to_boxed(payload);
          85  +
        /* ServerHttpBoundProtocolGenerator.kt:575 */
   60     86   
        builder.body(body)?
          87  +
        /* ServerHttpBoundProtocolGenerator.kt:433 */
   61     88   
    })
          89  +
    /* ServerHttpBoundProtocolGenerator.kt:421 */
   62     90   
}
   63     91   
          92  +
/* JsonParserGenerator.kt:148 */
   64     93   
pub(crate) fn de_result(
   65     94   
    value: &[u8],
   66     95   
    mut builder: crate::input::result_input::Builder,
   67     96   
) -> ::std::result::Result<
   68     97   
    crate::input::result_input::Builder,
   69     98   
    ::aws_smithy_json::deserialize::error::DeserializeError,
   70     99   
> {
         100  +
    /* JsonParserGenerator.kt:153 */
   71    101   
    let mut tokens_owned =
   72    102   
        ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value))
   73    103   
            .peekable();
   74    104   
    let tokens = &mut tokens_owned;
   75    105   
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
         106  +
    /* JsonParserGenerator.kt:684 */
   76    107   
    loop {
         108  +
        /* JsonParserGenerator.kt:685 */
   77    109   
        match tokens.next().transpose()? {
         110  +
            /* JsonParserGenerator.kt:686 */
   78    111   
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   79    112   
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
         113  +
                /* JsonParserGenerator.kt:260 */
   80    114   
                match key.to_unescaped()?.as_ref() {
         115  +
                    /* JsonParserGenerator.kt:262 */
   81    116   
                    "pv_member" => {
         117  +
                        /* JsonParserGenerator.kt:272 */
   82    118   
                        builder = builder.set_pv_member(
         119  +
                            /* JsonParserGenerator.kt:298 */
   83    120   
                            ::aws_smithy_json::deserialize::token::expect_bool_or_null(
   84    121   
                                tokens.next(),
   85         -
                            )?,
         122  +
                            )?, /* JsonParserGenerator.kt:272 */
   86    123   
                        );
         124  +
                        /* JsonParserGenerator.kt:262 */
   87    125   
                    }
   88         -
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
         126  +
                    /* JsonParserGenerator.kt:290 */
         127  +
                    _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
   89    128   
                }
         129  +
                /* JsonParserGenerator.kt:686 */
   90    130   
            }
         131  +
            /* JsonParserGenerator.kt:695 */
   91    132   
            other => {
   92    133   
                return Err(
   93    134   
                    ::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   94    135   
                        "expected object key or end object, found: {:?}",
   95    136   
                        other
   96    137   
                    )),
   97    138   
                )
         139  +
            } /* JsonParserGenerator.kt:685 */
   98    140   
        }
         141  +
        /* JsonParserGenerator.kt:684 */
   99    142   
    }
  100         -
    }
         143  +
    /* JsonParserGenerator.kt:250 */
  101    144   
    if tokens.next().is_some() {
         145  +
        /* JsonParserGenerator.kt:251 */
  102    146   
        return Err(
  103    147   
            ::aws_smithy_json::deserialize::error::DeserializeError::custom(
  104    148   
                "found more JSON tokens after completing parsing",
  105    149   
            ),
  106    150   
        );
         151  +
        /* JsonParserGenerator.kt:250 */
  107    152   
    }
         153  +
    /* JsonParserGenerator.kt:163 */
  108    154   
    Ok(builder)
         155  +
    /* JsonParserGenerator.kt:148 */
  109    156   
}

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

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