From 9c2a609be85aa06382f61d0077b2849e856f2967 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Mon, 21 Nov 2022 17:52:14 +0000 Subject: [PATCH 1/7] Fix builder_without_plugins link --- .../server/smithy/generators/ServerServiceGeneratorV2.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt index 7b553ee119..6f604a0c6c 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt @@ -343,7 +343,7 @@ class ServerServiceGeneratorV2( /// Constructs a builder for [`$serviceName`]. /// - /// Use [`$serviceName::builder_without_plugins`] if you need to specify plugins. + /// Use [`$serviceName::builder_with_plugins`] if you need to specify plugins. pub fn builder_without_plugins() -> $builderName { Self::builder_with_plugins(#{SmithyHttpServer}::plugin::IdentityPlugin) } From 418f8cbee7cb251b773005348334fe69f6c3bb7e Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Mon, 21 Nov 2022 22:47:27 +0000 Subject: [PATCH 2/7] Add operation_shape module docs --- .../ServerOperationShapeGenerator.kt | 111 ++++++++++++++++++ .../generators/ServerServiceGenerator.kt | 6 +- 2 files changed, 113 insertions(+), 4 deletions(-) create mode 100644 codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt new file mode 100644 index 0000000000..607d7bbe61 --- /dev/null +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt @@ -0,0 +1,111 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +package software.amazon.smithy.rust.codegen.server.smithy.generators + +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter +import software.amazon.smithy.rust.codegen.core.rustlang.Writable +import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate +import software.amazon.smithy.rust.codegen.core.rustlang.writable +import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext +import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget +import software.amazon.smithy.rust.codegen.core.smithy.Errors +import software.amazon.smithy.rust.codegen.core.smithy.Inputs +import software.amazon.smithy.rust.codegen.core.smithy.Outputs +import software.amazon.smithy.rust.codegen.core.smithy.generators.error.errorSymbol +import software.amazon.smithy.rust.codegen.core.util.inputShape +import software.amazon.smithy.rust.codegen.core.util.outputShape +import software.amazon.smithy.rust.codegen.core.util.toPascalCase +import software.amazon.smithy.rust.codegen.core.util.toSnakeCase +import software.amazon.smithy.rust.codegen.server.smithy.ServerCargoDependency + +class ServerOperationShapeGenerator( + private val operations: List, + private val codegenContext: CodegenContext, +) { + private val model = codegenContext.model + private val symbolProvider = codegenContext.symbolProvider + private val firstOperation = codegenContext.symbolProvider.toSymbol(operations[0]) + private val firstOperationName = firstOperation.name.toPascalCase() + private val crateName = codegenContext.settings.moduleName.toSnakeCase() + + /** + * Returns the function signature for an operation handler implementation. Used in the documentation. + */ + private fun OperationShape.docSignature(): Writable { + val inputSymbol = symbolProvider.toSymbol(inputShape(model)) + val outputSymbol = symbolProvider.toSymbol(outputShape(model)) + val errorSymbol = errorSymbol(model, symbolProvider, CodegenTarget.SERVER) + + val outputT = if (errors.isEmpty()) { + outputSymbol.name + } else { + "Result<${outputSymbol.name}, ${errorSymbol.name}>" + } + + return writable { + if (!errors.isEmpty()) { + rust("//! ## use $crateName::${Errors.namespace}::${errorSymbol.name};") + } + rust( + """ + //! ## use $crateName::${Inputs.namespace}::${inputSymbol.name}; + //! ## use $crateName::${Outputs.namespace}::${outputSymbol.name}; + //! async fn handler(input: ${inputSymbol.name}) -> $outputT { + //! todo!() + //! } + """.trimIndent(), + ) + } + } + + fun render(writer: RustWriter) { + if (operations.isEmpty()) { + return + } + + writer.rustTemplate( + """ + //! A collection of zero-sized types (ZSTs) representing each operation defined in the service closure. + //! + //! ## Constructing an [`Operation`](#{SmithyHttpServer}::operation::OperationShapeExt) + //! + //! To apply middleware to specific operations the [`Operation`](#{SmithyHttpServer}::operation::Operation) + //! API must be used. + //! + //! Using the [`OperationShapeExt`](#{SmithyHttpServer}::operation::OperationShapeExt) trait + //! implemented on each ZST we can construct an [`Operation`](#{SmithyHttpServer}::operation::Operation) + //! with appropriate constraints given by Smithy. + //! + //! #### Example + //! + //! ```no_run + //! use $crateName::operation_shape::$firstOperationName; + //! use #{SmithyHttpServer}::operation::OperationShapeExt; + #{Handler:W} + //! + //! let operation = $firstOperationName::from_handler(handler) + //! .layer(todo!("Provide a layer implementation")); + //! ``` + //! + //! ## Use as Marker Structs + //! + //! The [plugin system](#{SmithyHttpServer}::plugin) also makes use of these ZSTs to parameterize + //! [`Plugin`](#{SmithyHttpServer}::plugin::Plugin) implementations. The traits, such as + //! [`OperationShape`](#{SmithyHttpServer}::operation::OperationShape) can be used to provide + //! operation specific information to the [`Layer`](#{Tower}::Layer) being applied. + """.trimIndent(), + "SmithyHttpServer" to + ServerCargoDependency.SmithyHttpServer(codegenContext.runtimeConfig).toType(), + "Tower" to ServerCargoDependency.Tower.toType(), + "Handler" to operations[0].docSignature(), + ) + for (operation in operations) { + ServerOperationGenerator(codegenContext, operation).render(writer) + } + } +} diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGenerator.kt index ca6bd0fe5a..b5b471b496 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGenerator.kt @@ -35,6 +35,7 @@ open class ServerServiceGenerator( ) { private val index = TopDownIndex.of(codegenContext.model) protected val operations = index.getContainedOperations(codegenContext.serviceShape).sortedBy { it.id } + private val serviceName = codegenContext.serviceShape.id.name.toString() /** * Render Service Specific code. Code will end up in different files via [useShapeWriter]. See `SymbolVisitor.kt` @@ -42,7 +43,6 @@ open class ServerServiceGenerator( */ fun render() { rustCrate.lib { - val serviceName = codegenContext.serviceShape.id.name.toString() rust("##[doc(inline, hidden)]") rust("pub use crate::service::$serviceName;") } @@ -85,9 +85,7 @@ open class ServerServiceGenerator( ), ), ) { - for (operation in operations) { - ServerOperationGenerator(codegenContext, operation).render(this) - } + ServerOperationShapeGenerator(operations, codegenContext).render(this) } // TODO(https://github.com/awslabs/smithy-rs/issues/1707): Remove, this is temporary. From a167c22df65d773b0ea7f9831c0e655b4f6fd958 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Tue, 22 Nov 2022 10:53:30 +0000 Subject: [PATCH 3/7] Add doc tests to handler setters --- .../smithy/generators/DocHandlerGenerator.kt | 59 +++++++++++++++++++ .../ServerOperationShapeGenerator.kt | 50 ++-------------- .../generators/ServerServiceGeneratorV2.kt | 21 ++++++- 3 files changed, 84 insertions(+), 46 deletions(-) create mode 100644 codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt new file mode 100644 index 0000000000..a6ad3687ee --- /dev/null +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt @@ -0,0 +1,59 @@ +package software.amazon.smithy.rust.codegen.server.smithy.generators + +import software.amazon.smithy.model.shapes.OperationShape +import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter +import software.amazon.smithy.rust.codegen.core.rustlang.Writable +import software.amazon.smithy.rust.codegen.core.rustlang.rust +import software.amazon.smithy.rust.codegen.core.rustlang.writable +import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext +import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget +import software.amazon.smithy.rust.codegen.core.smithy.Errors +import software.amazon.smithy.rust.codegen.core.smithy.Inputs +import software.amazon.smithy.rust.codegen.core.smithy.Outputs +import software.amazon.smithy.rust.codegen.core.smithy.generators.error.errorSymbol +import software.amazon.smithy.rust.codegen.core.util.inputShape +import software.amazon.smithy.rust.codegen.core.util.outputShape +import software.amazon.smithy.rust.codegen.core.util.toSnakeCase + +/** +Generates a stub for use within documentation. + */ +class DocHandlerGenerator(private val operation: OperationShape, private val commentToken: String = "//", private val codegenContext: CodegenContext) { + private val model = codegenContext.model + private val symbolProvider = codegenContext.symbolProvider + private val crateName = codegenContext.settings.moduleName.toSnakeCase() + + /** + * Returns the function signature for an operation handler implementation. Used in the documentation. + */ + private fun OperationShape.docSignature(): Writable { + val inputSymbol = symbolProvider.toSymbol(inputShape(model)) + val outputSymbol = symbolProvider.toSymbol(outputShape(model)) + val errorSymbol = errorSymbol(model, symbolProvider, CodegenTarget.SERVER) + + val outputT = if (errors.isEmpty()) { + outputSymbol.name + } else { + "Result<${outputSymbol.name}, ${errorSymbol.name}>" + } + + return writable { + if (!errors.isEmpty()) { + rust("$commentToken ## use $crateName::${Errors.namespace}::${errorSymbol.name};") + } + rust( + """ + $commentToken ## use $crateName::${Inputs.namespace}::${inputSymbol.name}; + $commentToken ## use $crateName::${Outputs.namespace}::${outputSymbol.name}; + $commentToken async fn handler(input: ${inputSymbol.name}) -> $outputT { + $commentToken todo!() + $commentToken } + """.trimIndent(), + ) + } + } + + fun render(writer: RustWriter) { + operation.docSignature()(writer) + } +} diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt index 607d7bbe61..8ae62beca1 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerOperationShapeGenerator.kt @@ -7,18 +7,9 @@ package software.amazon.smithy.rust.codegen.server.smithy.generators import software.amazon.smithy.model.shapes.OperationShape import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter -import software.amazon.smithy.rust.codegen.core.rustlang.Writable import software.amazon.smithy.rust.codegen.core.rustlang.rust import software.amazon.smithy.rust.codegen.core.rustlang.rustTemplate -import software.amazon.smithy.rust.codegen.core.rustlang.writable import software.amazon.smithy.rust.codegen.core.smithy.CodegenContext -import software.amazon.smithy.rust.codegen.core.smithy.CodegenTarget -import software.amazon.smithy.rust.codegen.core.smithy.Errors -import software.amazon.smithy.rust.codegen.core.smithy.Inputs -import software.amazon.smithy.rust.codegen.core.smithy.Outputs -import software.amazon.smithy.rust.codegen.core.smithy.generators.error.errorSymbol -import software.amazon.smithy.rust.codegen.core.util.inputShape -import software.amazon.smithy.rust.codegen.core.util.outputShape import software.amazon.smithy.rust.codegen.core.util.toPascalCase import software.amazon.smithy.rust.codegen.core.util.toSnakeCase import software.amazon.smithy.rust.codegen.server.smithy.ServerCargoDependency @@ -27,47 +18,16 @@ class ServerOperationShapeGenerator( private val operations: List, private val codegenContext: CodegenContext, ) { - private val model = codegenContext.model - private val symbolProvider = codegenContext.symbolProvider - private val firstOperation = codegenContext.symbolProvider.toSymbol(operations[0]) - private val firstOperationName = firstOperation.name.toPascalCase() - private val crateName = codegenContext.settings.moduleName.toSnakeCase() - - /** - * Returns the function signature for an operation handler implementation. Used in the documentation. - */ - private fun OperationShape.docSignature(): Writable { - val inputSymbol = symbolProvider.toSymbol(inputShape(model)) - val outputSymbol = symbolProvider.toSymbol(outputShape(model)) - val errorSymbol = errorSymbol(model, symbolProvider, CodegenTarget.SERVER) - - val outputT = if (errors.isEmpty()) { - outputSymbol.name - } else { - "Result<${outputSymbol.name}, ${errorSymbol.name}>" - } - - return writable { - if (!errors.isEmpty()) { - rust("//! ## use $crateName::${Errors.namespace}::${errorSymbol.name};") - } - rust( - """ - //! ## use $crateName::${Inputs.namespace}::${inputSymbol.name}; - //! ## use $crateName::${Outputs.namespace}::${outputSymbol.name}; - //! async fn handler(input: ${inputSymbol.name}) -> $outputT { - //! todo!() - //! } - """.trimIndent(), - ) - } - } fun render(writer: RustWriter) { if (operations.isEmpty()) { return } + val firstOperation = codegenContext.symbolProvider.toSymbol(operations[0]) + val firstOperationName = firstOperation.name.toPascalCase() + val crateName = codegenContext.settings.moduleName.toSnakeCase() + writer.rustTemplate( """ //! A collection of zero-sized types (ZSTs) representing each operation defined in the service closure. @@ -102,7 +62,7 @@ class ServerOperationShapeGenerator( "SmithyHttpServer" to ServerCargoDependency.SmithyHttpServer(codegenContext.runtimeConfig).toType(), "Tower" to ServerCargoDependency.Tower.toType(), - "Handler" to operations[0].docSignature(), + "Handler" to DocHandlerGenerator(operations[0], "//!", codegenContext)::render, ) for (operation in operations) { ServerOperationGenerator(codegenContext, operation).render(writer) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt index 6f604a0c6c..252b091e56 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt @@ -23,7 +23,7 @@ import software.amazon.smithy.rust.codegen.server.smithy.ServerCargoDependency import software.amazon.smithy.rust.codegen.server.smithy.generators.protocol.ServerProtocol class ServerServiceGeneratorV2( - codegenContext: CodegenContext, + private val codegenContext: CodegenContext, private val protocol: ServerProtocol, ) { private val runtimeConfig = codegenContext.runtimeConfig @@ -32,12 +32,14 @@ class ServerServiceGeneratorV2( arrayOf( "Bytes" to CargoDependency.Bytes.toType(), "Http" to CargoDependency.Http.toType(), + "SmithyHttp" to CargoDependency.smithyHttp(runtimeConfig).toType(), "HttpBody" to CargoDependency.HttpBody.toType(), "SmithyHttpServer" to smithyHttpServer, "Tower" to CargoDependency.Tower.toType(), ) private val model = codegenContext.model private val symbolProvider = codegenContext.symbolProvider + val crateName = codegenContext.settings.moduleName.toSnakeCase() private val service = codegenContext.serviceShape private val serviceName = service.id.name.toPascalCase() @@ -101,6 +103,22 @@ class ServerServiceGeneratorV2( /// /// This should be an async function satisfying the [`Handler`](#{SmithyHttpServer}::operation::Handler) trait. /// See the [operation module documentation](#{SmithyHttpServer}::operation) for more information. + /// + /// ## Example + /// + /// ```no_run + /// use $crateName::$serviceName; + /// + #{Handler:W} + /// + /// let app = $serviceName::builder_without_plugins() + /// .$fieldName(handler) + /// /* Set other handlers */ + /// .build() + /// .unwrap(); + /// ## let app: $serviceName<#{SmithyHttpServer}::routing::Route<#{SmithyHttp}::body::SdkBody>> = app; + /// ``` + /// pub fn $fieldName(self, handler: HandlerType) -> Self where HandlerType: #{SmithyHttpServer}::operation::Handler, @@ -138,6 +156,7 @@ class ServerServiceGeneratorV2( } """, "Protocol" to protocol.markerStruct(), + "Handler" to DocHandlerGenerator(operationShape, "///", codegenContext)::render, *codegenScope, ) From 0499e5e19f650e39d579f9ae003cbcf2255ac243 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Tue, 22 Nov 2022 11:20:52 +0000 Subject: [PATCH 4/7] Add copyright --- .../codegen/server/smithy/generators/DocHandlerGenerator.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt index a6ad3687ee..6407c24f1b 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/DocHandlerGenerator.kt @@ -1,3 +1,8 @@ +/* + * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + package software.amazon.smithy.rust.codegen.server.smithy.generators import software.amazon.smithy.model.shapes.OperationShape From cc10a14a51349babe4dc1ade5ca3fd25b509fc20 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Tue, 22 Nov 2022 13:44:51 +0000 Subject: [PATCH 5/7] Add documentation to MissingOperationsError --- .../server/smithy/generators/ServerServiceGeneratorV2.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt index 252b091e56..419997e2f6 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt @@ -434,6 +434,8 @@ class ServerServiceGeneratorV2( private fun missingOperationsError(): Writable = writable { rust( """ + /// The error encountered when calling the [`$builderName::build`] method while one or more operations are not + /// specified. ##[derive(Debug)] pub struct MissingOperationsError { operation_names2setter_methods: std::collections::HashMap<&'static str, &'static str>, From de0a66d2a01ed69331d4e3b9eaa665c0d6be7686 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Tue, 22 Nov 2022 13:51:28 +0000 Subject: [PATCH 6/7] Improve build method documentation --- .../server/smithy/generators/ServerServiceGeneratorV2.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt index 419997e2f6..1090aa5d84 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt @@ -198,6 +198,9 @@ class ServerServiceGeneratorV2( /// Constructs a [`$serviceName`] from the arguments provided to the builder. /// /// Forgetting to register a handler for one or more operations will result in an error. + /// + /// Check out [`$builderName::build_unchecked`] if you'd prefer the service to return status code 500 when an + /// unspecified route requested. pub fn build(self) -> Result<$serviceName<#{SmithyHttpServer}::routing::Route<$builderBodyGenericTypeName>>, MissingOperationsError> { let router = { From 778769527daebd0d159402e96caf51023fd733a4 Mon Sep 17 00:00:00 2001 From: Harry Barber <106155934+hlbarber@users.noreply.github.com> Date: Tue, 22 Nov 2022 14:39:35 +0000 Subject: [PATCH 7/7] Update codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt Co-authored-by: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> --- .../server/smithy/generators/ServerServiceGeneratorV2.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt index 1090aa5d84..3bec41bde1 100644 --- a/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt +++ b/codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/generators/ServerServiceGeneratorV2.kt @@ -437,7 +437,7 @@ class ServerServiceGeneratorV2( private fun missingOperationsError(): Writable = writable { rust( """ - /// The error encountered when calling the [`$builderName::build`] method while one or more operations are not + /// The error encountered when calling the [`$builderName::build`] method if one or more operation handlers are not /// specified. ##[derive(Debug)] pub struct MissingOperationsError {