Skip to content

Commit f003000

Browse files
authored
Update docs for non aws-config config builders (#3960)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> Partially addresses awslabs/aws-sdk-rust#1226, although we might want to look into going further and actually deprecating or warning on these builder methods. ## Description <!--- Describe your changes in detail --> ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Doc only update ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent 845bb91 commit f003000

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/generators/config/ServiceConfigGenerator.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@ class ServiceConfigGenerator(
399399
}
400400

401401
fun render(writer: RustWriter) {
402+
val configDocs = """
403+
Constructs a config builder.
404+
<div class="warning">
405+
Note that a config created from this builder will not have the same safe defaults as one created by
406+
the <a href="https://crates.io/crates/aws-config" target="_blank">aws-config</a> crate.
407+
</div>
408+
"""
402409
writer.docs("Configuration for a $moduleUseName service client.\n")
403410
customizations.forEach {
404411
it.section(ServiceConfig.ConfigStructAdditionalDocs)(writer)
@@ -424,9 +431,9 @@ class ServiceConfigGenerator(
424431
}
425432

426433
writer.rustBlock("impl Config") {
434+
writer.docs(configDocs)
427435
writer.rustTemplate(
428436
"""
429-
/// Constructs a config builder.
430437
pub fn builder() -> Builder { Builder::default() }
431438
""",
432439
)
@@ -483,7 +490,7 @@ class ServiceConfigGenerator(
483490
}
484491

485492
writer.rustBlock("impl Builder") {
486-
writer.docs("Constructs a config builder.")
493+
writer.docs(configDocs)
487494
writer.rust("pub fn new() -> Self { Self::default() }")
488495

489496
builderFromConfigBag()(this)

0 commit comments

Comments
 (0)