Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC30 #2615

Open
wants to merge 439 commits into
base: main
Choose a base branch
from
Open

RFC30 #2615

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
439 commits
Select commit Hold shift + click to select a range
bf2cf28
Merge commit '234b2e4c83cfe8c347ef7d4e6dd9381b7837cbc9' into RFC30/do…
thomas-k-cameron May 2, 2023
c216199
document
thomas-k-cameron May 2, 2023
9aba861
update
thomas-k-cameron May 2, 2023
c209b13
update
thomas-k-cameron May 3, 2023
6f220f4
Merge commit 'e1cf72e52d152519f57a66d95a23322fe1de0759' into RFC30/Blob
thomas-k-cameron May 3, 2023
e2f92de
pre-commit
thomas-k-cameron May 3, 2023
23df5a8
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron May 3, 2023
d07e664
Merge branch 'main' into RFC30/Blob
thomas-k-cameron May 5, 2023
afd64a9
FIX
thomas-k-cameron May 5, 2023
be7dbbb
Merge branch 'main' into RFC30/Blob
thomas-k-cameron May 5, 2023
be405e4
updater
thomas-k-cameron May 5, 2023
6298c76
Merge branch 'main' into RFC30/compiletime-benchmark-to-ci
thomas-k-cameron May 5, 2023
6d1f1de
Update ci.yml
thomas-k-cameron May 5, 2023
ba93ad7
Merge branch 'main' into RFC30/Blob
thomas-k-cameron May 11, 2023
ff729b5
Merge branch 'main' into RFC30/Blob
thomas-k-cameron May 15, 2023
fe9cfa9
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron May 24, 2023
808c645
Merge branch 'main' into RFC30/Blob
thomas-k-cameron May 28, 2023
50ad110
Shorten doc comment
jdisanti May 30, 2023
4e31189
Merge branch 'main' into RFC30/number
jdisanti May 30, 2023
e387795
add ciborium
thomas-k-cameron May 30, 2023
37bea69
add ciborium
thomas-k-cameron May 30, 2023
ff47d3e
update
thomas-k-cameron May 30, 2023
dab61c0
Merge branch 'main' into RFC30/Blob
thomas-k-cameron May 30, 2023
5fbd4cf
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron May 30, 2023
d8d5169
update
thomas-k-cameron May 30, 2023
cc92bba
update
thomas-k-cameron May 30, 2023
0874bbd
fix
thomas-k-cameron May 31, 2023
abcaa83
update
thomas-k-cameron May 31, 2023
ffe2713
fix
thomas-k-cameron May 31, 2023
cb0a64a
update
thomas-k-cameron May 31, 2023
32eb725
Merge branch 'main' into RFC30/date_time
thomas-k-cameron May 31, 2023
ab1eef5
lint fix
thomas-k-cameron May 31, 2023
db368bc
Merge branch 'RFC30/date_time' of https://github.com/thomas-k-cameron…
thomas-k-cameron May 31, 2023
d9f362b
FIX docs
thomas-k-cameron May 31, 2023
fe1cbce
FIX
thomas-k-cameron May 31, 2023
06a3cba
Merge branch 'main' into RFC30/serde-decorator
thomas-k-cameron May 31, 2023
c9a4ae0
Merge branch 'main' into RFC30/add-set-fields
thomas-k-cameron May 31, 2023
893692a
Update FluentClientGenerator.kt
thomas-k-cameron May 31, 2023
c2cce08
update
thomas-k-cameron May 31, 2023
48c04f8
update
thomas-k-cameron Jun 1, 2023
bbd94ba
update
thomas-k-cameron Jun 1, 2023
5a8f9d3
Merge branch 'main' into RFC30/date_time
thomas-k-cameron Jun 1, 2023
75e84e7
Update FluentClientGenerator.kt
thomas-k-cameron Jun 1, 2023
2b1a69f
update
thomas-k-cameron Jun 1, 2023
7115727
Merge branch 'main' into RFC30/add-set-fields
thomas-k-cameron Jun 1, 2023
792e0e9
update
thomas-k-cameron Jun 1, 2023
4dfd9fb
Delete serde_impl_check.rs
thomas-k-cameron Jun 1, 2023
9f2e9c3
Delete Cargo.toml
thomas-k-cameron Jun 1, 2023
98dcb33
Delete deser.rs
thomas-k-cameron Jun 1, 2023
3610a39
Delete ser.rs
thomas-k-cameron Jun 1, 2023
a0655b2
Update lib.rs
thomas-k-cameron Jun 1, 2023
62e295c
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 1, 2023
3650242
update
thomas-k-cameron Jun 1, 2023
ad6acba
update
thomas-k-cameron Jun 1, 2023
47593d4
update
thomas-k-cameron Jun 1, 2023
84e5758
update
thomas-k-cameron Jun 1, 2023
446d2ef
fix
thomas-k-cameron Jun 1, 2023
04f294e
update
thomas-k-cameron Jun 1, 2023
535cb68
fix
thomas-k-cameron Jun 1, 2023
c047c6e
FIX
thomas-k-cameron Jun 1, 2023
739d2c8
update
thomas-k-cameron Jun 1, 2023
72f15cd
update
thomas-k-cameron Jun 2, 2023
ad8f413
update fluent client
thomas-k-cameron Jun 2, 2023
e2b77cb
Merge branch 'main' into RFC30/date_time
thomas-k-cameron Jun 2, 2023
d1069dc
fix
thomas-k-cameron Jun 2, 2023
2cb1e9b
update
thomas-k-cameron Jun 2, 2023
663dff3
update
thomas-k-cameron Jun 2, 2023
8b38afc
update
thomas-k-cameron Jun 2, 2023
525f572
update
thomas-k-cameron Jun 2, 2023
e3367dd
update
thomas-k-cameron Jun 2, 2023
f5f1f4e
FIX
thomas-k-cameron Jun 2, 2023
ec9432a
update
thomas-k-cameron Jun 2, 2023
dc21f19
update
thomas-k-cameron Jun 2, 2023
5972800
update
thomas-k-cameron Jun 2, 2023
54a187b
Merge branch 'main' into RFC30/add-set-fields
thomas-k-cameron Jun 2, 2023
e850ea2
update
thomas-k-cameron Jun 2, 2023
8b2877e
update
thomas-k-cameron Jun 2, 2023
4be97c3
update
thomas-k-cameron Jun 2, 2023
ca47afe
change input path
thomas-k-cameron Jun 2, 2023
3bd1a7b
update
thomas-k-cameron Jun 2, 2023
a0a4651
update
thomas-k-cameron Jun 2, 2023
299e5ec
FIX
thomas-k-cameron Jun 3, 2023
605689e
updater
thomas-k-cameron Jun 3, 2023
ef38bbd
Merge branch 'main' into RFC30/add-set-fields
thomas-k-cameron Jun 3, 2023
857f3d4
FIX
thomas-k-cameron Jun 3, 2023
7bd1365
asdf
thomas-k-cameron Jun 3, 2023
e5cd52f
update
thomas-k-cameron Jun 3, 2023
a4bbee1
Merge branch 'main' into RFC30/date_time
thomas-k-cameron Jun 4, 2023
9006b71
Merge branch 'main' into RFC30/compiletime-benchmark-to-ci
thomas-k-cameron Jun 5, 2023
929ff0d
update
thomas-k-cameron Jun 5, 2023
e1c1b40
fix
thomas-k-cameron Jun 5, 2023
2eb7c42
update
thomas-k-cameron Jun 5, 2023
5639356
precommit
thomas-k-cameron Jun 5, 2023
b97a85c
update
thomas-k-cameron Jun 5, 2023
34eaadb
update
thomas-k-cameron Jun 5, 2023
09672b0
update
thomas-k-cameron Jun 5, 2023
5de9d85
Merge branch 'main' into RFC30/compiletime-benchmark-to-ci
thomas-k-cameron Jun 5, 2023
3d47d56
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 5, 2023
e292f6d
Merge commit '4e31189d7043317c4454e0dcbbaeddddb11b920f' into RFC30/ko…
thomas-k-cameron Jun 5, 2023
a14c34c
Merge commit 'ffe271363f042ba52e43081f55f0862eca8770fd' into RFC30/ko…
thomas-k-cameron Jun 5, 2023
394de16
Merge commit '06a3cba6f146576a9f8a43e1b62fa020ca04aaed' into RFC30/ko…
thomas-k-cameron Jun 5, 2023
1ef454a
update
thomas-k-cameron Jun 5, 2023
71fb1fe
Merge commit '5de9d8512173b7d986a82e5ed2dc10b927561da7' into RFC30/ko…
thomas-k-cameron Jun 5, 2023
05fa5b5
Merge commit 'b97a85c841fad4a08ffbfa66c5c75dc33276f3cf' into RFC30/ko…
thomas-k-cameron Jun 5, 2023
e7758fd
Merge commit 'c216199245119b272bd2bca7071d5109e026b255' into RFC30/ko…
thomas-k-cameron Jun 5, 2023
9570c53
pre-commit
thomas-k-cameron Jun 5, 2023
5f0ad1b
fix
thomas-k-cameron Jun 5, 2023
1fb6910
update
thomas-k-cameron Jun 5, 2023
76fe11d
fix
thomas-k-cameron Jun 5, 2023
c4ab823
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 5, 2023
c12c360
Merge branch 'RFC30/kotlin-codegen-core' of https://github.com/thomas…
thomas-k-cameron Jun 5, 2023
2efda16
update
thomas-k-cameron Jun 6, 2023
7787563
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 11, 2023
6e38a83
Merge branch 'main' into RFC30/serde-decorator
thomas-k-cameron Jun 14, 2023
495ad68
Merge branch 'main' into RFC30/serde-decorator
thomas-k-cameron Jun 14, 2023
b15f93a
fix
thomas-k-cameron Jun 14, 2023
388ee18
asdf
thomas-k-cameron Jun 14, 2023
9ae6c0f
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 14, 2023
55daa77
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 20, 2023
3a998e5
fix
thomas-k-cameron Jun 20, 2023
fc65623
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jun 22, 2023
ad4ac09
asdf
thomas-k-cameron Jun 22, 2023
e019369
fix
thomas-k-cameron Jun 22, 2023
4f65d8d
add
thomas-k-cameron Jun 22, 2023
efc0e20
Merge branch 'main' into RFC30/tests
thomas-k-cameron Jun 22, 2023
8565bf2
test
thomas-k-cameron Jun 22, 2023
f578b86
Update codegen-core/src/main/kotlin/software/amazon/smithy/rust/codeg…
thomas-k-cameron Jun 22, 2023
268b876
Merge branch 'main' into RFC30/test2
thomas-k-cameron Jun 27, 2023
a3e8546
Update codegen-client/src/main/kotlin/software/amazon/smithy/rust/cod…
thomas-k-cameron Jun 29, 2023
d614f5f
Rust.kt
thomas-k-cameron Jun 29, 2023
31c16bd
Merge branch 'RFC30/test2' of https://github.com/thomas-k-cameron/smi…
thomas-k-cameron Jun 29, 2023
0df1dfb
Merge branch 'main' into RFC30/test2
thomas-k-cameron Jun 29, 2023
e6512fb
asdf
thomas-k-cameron Jun 29, 2023
3624b37
pre-commit
thomas-k-cameron Jun 29, 2023
e0311c3
check
thomas-k-cameron Jun 29, 2023
6e87b13
Update codegen-core/src/main/kotlin/software/amazon/smithy/rust/codeg…
thomas-k-cameron Jun 29, 2023
2f25042
Update codegen-core/src/main/kotlin/software/amazon/smithy/rust/codeg…
thomas-k-cameron Jun 29, 2023
b0c4133
Apply suggestions from code review
thomas-k-cameron Jun 29, 2023
2284425
Merge branch 'main' into RFC30/tests
thomas-k-cameron Jun 29, 2023
7e06e0c
FIX
thomas-k-cameron Jun 29, 2023
1acf514
Merge branch 'main' into RFC30/test2
thomas-k-cameron Jun 29, 2023
84c943d
fix
thomas-k-cameron Jun 29, 2023
7f9329d
Merge branch 'main' into RFC30/tests
thomas-k-cameron Jun 29, 2023
c2abf69
fix
thomas-k-cameron Jun 29, 2023
c358294
fix
thomas-k-cameron Jun 29, 2023
99113b5
enable by default
thomas-k-cameron Jun 29, 2023
1e4ec95
Merge branch 'main' into RFC30/test2
thomas-k-cameron Jun 29, 2023
5a36064
fix
thomas-k-cameron Jun 29, 2023
2b24f9d
Merge branch 'RFC30/test2' of https://github.com/thomas-k-cameron/smi…
thomas-k-cameron Jun 29, 2023
149711f
Merge branch 'main' into RFC30/tests
thomas-k-cameron Jul 1, 2023
a90147f
update
thomas-k-cameron Jul 3, 2023
79a2957
squash
thomas-k-cameron Jul 4, 2023
f02b3e7
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jul 4, 2023
75c091d
add compilation guard
thomas-k-cameron Jul 4, 2023
71cfdf7
update
thomas-k-cameron Jul 4, 2023
7f8162d
update
thomas-k-cameron Jul 4, 2023
ad001ca
refactoring
thomas-k-cameron Jul 4, 2023
c49b208
update
thomas-k-cameron Jul 4, 2023
1c24991
update
thomas-k-cameron Jul 4, 2023
5b5f201
update
thomas-k-cameron Jul 4, 2023
81f7efd
update
thomas-k-cameron Jul 4, 2023
e6dbd97
update
thomas-k-cameron Jul 4, 2023
9e997b6
update
thomas-k-cameron Jul 4, 2023
6f35925
Rfc30/compiletime benchmark to ci (#22)
thomas-k-cameron Jul 4, 2023
970d4c2
Update Rust.kt
thomas-k-cameron Jul 4, 2023
cc33514
Update Rust.kt
thomas-k-cameron Jul 4, 2023
8d78bd4
fix
thomas-k-cameron Jul 6, 2023
7d80faf
better docs
thomas-k-cameron Jul 6, 2023
5756a41
update
thomas-k-cameron Jul 6, 2023
01a69fc
Merge branch 'main' into RFC30/test2
thomas-k-cameron Jul 6, 2023
0dca49e
Merge branches 'RFC30/test2' and 'RFC30/test2' of https://github.com/…
thomas-k-cameron Jul 6, 2023
1496901
fix
thomas-k-cameron Jul 6, 2023
73b40a4
fix
thomas-k-cameron Jul 6, 2023
2647de9
update
thomas-k-cameron Jul 6, 2023
16b51e3
Merge branch 'main' into RFC30/test2
thomas-k-cameron Jul 10, 2023
ef778af
Update SerdeDecorator.kt
thomas-k-cameron Jul 10, 2023
83cc5b5
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jul 16, 2023
0d5a831
Merge commit 'ef778af0e7023bf7cdcfb77154226496b84e8f0d' into RFC30/ko…
thomas-k-cameron Jul 16, 2023
220fd4c
Merge commit '16b51e3b74b19ff2df7c087efe56a2f5190781b1' into RFC30/ko…
thomas-k-cameron Jul 16, 2023
d236687
Merge commit 'c2abf697f666619d454d5994b53ae83841526125' into RFC30/ko…
thomas-k-cameron Jul 16, 2023
0b80fff
fix
thomas-k-cameron Jul 16, 2023
770da16
modified: aws/sdk-codegen/src/main/kotlin/software/amazon/s…
thomas-k-cameron Jul 16, 2023
bc1c05c
asdf
thomas-k-cameron Jul 16, 2023
8becf06
fix
thomas-k-cameron Jul 16, 2023
2b91272
asdf
thomas-k-cameron Jul 16, 2023
40a3322
fix
thomas-k-cameron Jul 16, 2023
b07a3bc
asdf
thomas-k-cameron Jul 16, 2023
7b0a825
asdf
thomas-k-cameron Jul 16, 2023
535127e
update
thomas-k-cameron Jul 16, 2023
7882c7f
asdf
thomas-k-cameron Jul 16, 2023
0e5156f
Merge branch 'main' into RFC30/blob-fixing
thomas-k-cameron Jul 16, 2023
c998094
Update check-aws-sdk-smoketest-docs-clippy-udeps
thomas-k-cameron Jul 16, 2023
210b9c8
asdf
thomas-k-cameron Jul 16, 2023
77bd0de
Update CodegenDelegator.kt
thomas-k-cameron Jul 16, 2023
92cd3f8
Update LibRsGenerator.kt
thomas-k-cameron Jul 16, 2023
bbb321e
asdf
thomas-k-cameron Jul 16, 2023
fa8c04b
asdf
thomas-k-cameron Jul 16, 2023
918f2cd
Update LibRsGenerator.kt
thomas-k-cameron Jul 16, 2023
8802e83
Update SerdeDecorator.kt
thomas-k-cameron Jul 16, 2023
5211559
asdf
thomas-k-cameron Jul 16, 2023
88c14cb
Merge branch 'main' into RFC30/serde-decorator
thomas-k-cameron Jul 16, 2023
c4a41c2
update
thomas-k-cameron Jul 16, 2023
dd4a511
asdf
thomas-k-cameron Jul 17, 2023
982a95d
Delete devcontainer.json
thomas-k-cameron Jul 18, 2023
954b7e9
Merge branch 'main' into RFC30/serde-decorator
thomas-k-cameron Jul 20, 2023
d83fdb7
Merge commit '0e5156f67e0128f6714af2b6cb956a1855fb786e' into RFC30/ko…
thomas-k-cameron Jul 30, 2023
27b667a
Merge commit '210b9c855bcf25c38c9bbecc6da8ab36e9eb7b4a' into RFC30/ko…
thomas-k-cameron Jul 30, 2023
6a4afe8
Merge commit '954b7e9168128dae84490a431fe85928aea19dad' into RFC30/ko…
thomas-k-cameron Jul 30, 2023
fd17883
Merge commit '149711f978d1ba6a4311042907622b20d27f66a7' into RFC30/ko…
thomas-k-cameron Jul 30, 2023
b08e2ca
Merge commit 'd2690e7ab19c1ca98124ec1d5870ebfe25613879' into RFC30/ko…
thomas-k-cameron Jul 30, 2023
c969377
fix
thomas-k-cameron Jul 30, 2023
c12f3d4
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Aug 6, 2023
7974c27
ok
thomas-k-cameron Aug 6, 2023
4d65b27
ok
thomas-k-cameron Aug 6, 2023
7cbd610
ok
thomas-k-cameron Aug 6, 2023
db5fc49
ok
thomas-k-cameron Aug 6, 2023
5ce4723
ok
thomas-k-cameron Aug 6, 2023
5345cd0
RUSTFLAG*S*
thomas-k-cameron Aug 11, 2023
1560c76
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Aug 11, 2023
e4157d3
Update CodegenTestCommon.kt
thomas-k-cameron Aug 11, 2023
6d00795
test
thomas-k-cameron Aug 11, 2023
fb9892f
ok
thomas-k-cameron Aug 11, 2023
ad0def0
Merge branch 'RFC30/kotlin-codegen-core' of https://github.com/thomas…
thomas-k-cameron Aug 11, 2023
6b08178
Update ci.yml
thomas-k-cameron Aug 11, 2023
e280f62
Update ci.yml
thomas-k-cameron Aug 12, 2023
14040cb
revert
thomas-k-cameron Aug 23, 2023
316010e
remove export RUSTFLAGS="--cfg aws_sdk_unstable"
thomas-k-cameron Aug 23, 2023
b64f46a
Merge branch 'RFC30/kotlin-codegen-core' of https://github.com/thomas…
thomas-k-cameron Aug 23, 2023
c948f8d
# modified: .github/workflows/ci.yml
thomas-k-cameron Aug 23, 2023
334f428
asdf
thomas-k-cameron Aug 23, 2023
43f1677
asdf
thomas-k-cameron Aug 23, 2023
4ab1f9c
asdf
thomas-k-cameron Aug 23, 2023
c91a155
asdf
thomas-k-cameron Aug 23, 2023
270fe2f
Merge branch 'awslabs:main' into RFC30/kotlin-codegen-core
thomas-k-cameron Aug 23, 2023
53e37ca
asdf
thomas-k-cameron Aug 23, 2023
e6947c4
asdf
thomas-k-cameron Aug 24, 2023
ccc966d
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Aug 24, 2023
9526ff7
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Sep 6, 2023
dca47db
update
thomas-k-cameron Sep 6, 2023
651af86
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Nov 7, 2023
312a853
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Dec 3, 2023
077c611
update
thomas-k-cameron Dec 3, 2023
8350a45
update
thomas-k-cameron Dec 3, 2023
2ba9b75
modified: codegen-client/src/main/kotlin/software/amazon/smithy/rus…
thomas-k-cameron Dec 3, 2023
8f386af
modified: codegen-core/src/main/kotlin/software/amazon/smithy/rust/…
thomas-k-cameron Dec 3, 2023
6508d8b
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Dec 12, 2023
ed9f046
merge
thomas-k-cameron Jan 22, 2024
a57a62d
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron Jan 22, 2024
a081c6d
modified: codegen-client/src/main/kotlin/software/amazon/smithy/rus…
Jan 23, 2024
1e9b021
Merge branch 'main' into RFC30/kotlin-codegen-core
thomas-k-cameron May 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import org.jsoup.nodes.TextNode
import software.amazon.smithy.model.traits.DocumentationTrait
import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext
import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator
import software.amazon.smithy.rust.codegen.client.smithy.customize.SerdeDecorator
import software.amazon.smithy.rust.codegen.core.rustlang.CargoDependency
import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter
import software.amazon.smithy.rust.codegen.core.rustlang.Writable
Expand Down
4 changes: 0 additions & 4 deletions buildSrc/src/main/kotlin/CodegenTestCommon.kt
Original file line number Diff line number Diff line change
Expand Up @@ -268,29 +268,25 @@ fun Project.registerCargoCommandsTasks(
this.tasks.register<Exec>(Cargo.CHECK.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "check", "--lib", "--tests", "--benches", "--all-features")
}

this.tasks.register<Exec>(Cargo.TEST.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "test", "--all-features", "--no-fail-fast")
}

this.tasks.register<Exec>(Cargo.DOCS.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTDOCFLAGS", defaultRustDocFlags)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "doc", "--no-deps", "--document-private-items")
}

this.tasks.register<Exec>(Cargo.CLIPPY.toString) {
dependsOn(dependentTasks)
workingDir(outputDir)
environment("RUSTFLAGS", "--cfg aws_sdk_unstable")
commandLine("cargo", "clippy")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import software.amazon.smithy.rust.codegen.client.smithy.customizations.Sensitiv
import software.amazon.smithy.rust.codegen.client.smithy.customize.ClientCodegenDecorator
import software.amazon.smithy.rust.codegen.client.smithy.customize.CombinedClientCodegenDecorator
import software.amazon.smithy.rust.codegen.client.smithy.customize.RequiredCustomizations
import software.amazon.smithy.rust.codegen.client.smithy.customize.SerdeDecorator
import software.amazon.smithy.rust.codegen.client.smithy.endpoint.EndpointParamsDecorator
import software.amazon.smithy.rust.codegen.client.smithy.endpoint.EndpointsDecorator
import software.amazon.smithy.rust.codegen.client.smithy.generators.client.FluentClientDecorator
Expand Down Expand Up @@ -59,6 +60,7 @@ class RustClientCodegenPlugin : ClientDecoratableBuildPlugin() {
val codegenDecorator =
CombinedClientCodegenDecorator.fromClasspath(
context,
SerdeDecorator(),
ClientCustomizations(),
RequiredCustomizations(),
FluentClientDecorator(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package software.amazon.smithy.rust.codegen.client.smithy.customize

import software.amazon.smithy.rust.codegen.client.smithy.ClientCodegenContext
import software.amazon.smithy.rust.codegen.core.rustlang.containerDocs
import software.amazon.smithy.rust.codegen.core.rustlang.Feature
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.writable
import software.amazon.smithy.rust.codegen.core.smithy.RustCrate
import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsCustomization
import software.amazon.smithy.rust.codegen.core.smithy.generators.LibRsSection
import software.amazon.smithy.rust.codegen.core.smithy.generators.ModuleDocSection

/**
* Decorator that adds the `serde-serialize` and `serde-deserialize` features.
*/
class SerdeDecorator : ClientCodegenDecorator {
override val name: String = "SerdeDecorator"
override val order: Byte = 5

override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) {
fun feature(featureName: String): Feature {
return Feature(featureName, false, listOf("aws-smithy-types/$featureName"))
}
rustCrate.mergeFeature(feature("serde-serialize"))
rustCrate.mergeFeature(feature("serde-deserialize"))

}

override fun libRsCustomizations(
codegenContext: ClientCodegenContext,
baseCustomizations: List<LibRsCustomization>
): List<LibRsCustomization> {
return baseCustomizations + SerdeDocGenerator(codegenContext)
}
}

class SerdeDocGenerator(private val codegenContext: ClientCodegenContext) : LibRsCustomization() {
override fun section(section: LibRsSection): Writable {
return when (section) {
is LibRsSection.ModuleDoc->
if (section.subsection is ModuleDocSection.AWSSdkUnstable) {
serdeInfoText()
} else {
emptySection
}

else -> emptySection
}
}

private fun serdeInfoText(): Writable {
return writable {
containerDocs(
"""
## How to enable `Serialize` and `Deserialize`

This data type implements `Serialize` and `Deserialize` traits from the popular serde crate, but those traits are behind feature gate.

As they increase it's compile time dramatically, you should not turn them on unless it's necessary.
Implementation of `serde` traits in AWS SDK for Rust is still unstable, and implementation may change anytime in future.

To enable traits, you must pass `aws_sdk_unstable` to RUSTFLAGS and enable `serde-serialize` or `serde-deserialize` feature.

e.g.
```bash,no_run
export RUSTFLAGS="--cfg aws_sdk_unstable"
cargo build --features serde-serialize serde-deserialize
```

If you enable `serde-serialize` and/or `serde-deserialize` without `RUSTFLAGS="--cfg aws_sdk_unstable"`,
compilation will fail with warning.

""".trimIndent()
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGenerator
import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumGeneratorContext
import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumMemberModel
import software.amazon.smithy.rust.codegen.core.smithy.generators.EnumType
import software.amazon.smithy.rust.codegen.core.smithy.generators.RenderSerdeAttribute
import software.amazon.smithy.rust.codegen.core.util.dq

/** Infallible enums have an `Unknown` variant and can't fail to parse */
Expand Down Expand Up @@ -158,6 +159,8 @@ data class InfallibleEnumType(
This is not intended to be used directly.
""".trimIndent(),
)

RenderSerdeAttribute.addSerdeWithoutShapeModel(this)
context.enumMeta.render(this)
rustTemplate("struct $UnknownVariantValue(pub(crate) #{String});", *preludeScope)
rustBlock("impl $UnknownVariantValue") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,11 @@ class Attribute(val inner: Writable, val isDeriveHelper: Boolean = false) {
}
}

fun attributeWithStringAsArgument(runtimeType: RuntimeType, comment: String): Writable = {
// Sorted derives look nicer than unsorted, and it makes test output easier to predict
rustInline("#W(\"$comment\")", runtimeType.writable)
}

fun derive(runtimeTypes: Collection<RuntimeType>): Writable = derive(*runtimeTypes.toTypedArray())

fun pair(pair: Pair<String, String>): Writable =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,16 @@ class BuilderGenerator(
writer.docs("A builder for #D.", structureSymbol)
metadata.additionalAttributes.render(writer)
Attribute(derive(builderDerives)).render(writer)
RenderSerdeAttribute.addSerde(writer, shape, model)
RenderSerdeAttribute.addSensitiveWarningDoc(writer, shape, model)
writer.rustBlock("pub struct $builderName") {
// add serde
for (member in members) {
val memberName = symbolProvider.toMemberName(member)
// All fields in the builder are optional.
val memberSymbol = symbolProvider.toSymbol(member).makeOptional()
RenderSerdeAttribute.skipIfStream(writer, member, model, shape)
RenderSerdeAttribute.addSensitiveWarningDoc(writer, shape, model)
renderBuilderMember(this, memberName, memberSymbol)
}
writeCustomizations(customizations, BuilderSection.AdditionalFields(shape))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,18 @@ class CargoTomlGenerator(
"dev-dependencies" to
dependencies.filter { it.scope == DependencyScope.Dev }
.associate { it.name to it.toMap() },
"target.'cfg(aws_sdk_unstable)'.dependencies" to dependencies.filter {
it.scope == DependencyScope.CfgUnstable
}
.associate { it.name to it.toMap() },
"features" to cargoFeatures.toMap(),
).deepMergeWith(manifestCustomizations)

writer.writeWithNoFormatting(TomlWriter().write(cargoToml))
// NOTE: without this it will produce ["target.'cfg(aws_sdk_unstable)'.dependencies"]
// In JSON, this is an equivalent of: {"target.'cfg(aws_sdk_unstable)'.dependencies" : ...}
// To make it work, it has to be: {"target": {'cfg(aws_sdk_unstable)': {"dependencies": ...}}}
// This piece of code fixes it.
var tomlString = TomlWriter().write(cargoToml).replace("\"target.'cfg(aws_sdk_unstable)'.dependencies\"", "target.'cfg(aws_sdk_unstable)'.dependencies")
writer.writeWithNoFormatting(tomlString)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ open class EnumGenerator(
private fun RustWriter.renderUnnamedEnum() {
documentShape(shape, model)
deprecatedShape(shape)
RenderSerdeAttribute.addSerde(this, shape, model)
RenderSerdeAttribute.addSensitiveWarningDoc(this, shape, model)
context.enumMeta.render(this)
rust("struct ${context.enumName}(String);")
implBlock(
Expand Down Expand Up @@ -279,6 +281,8 @@ open class EnumGenerator(
)
deprecatedShape(shape)

RenderSerdeAttribute.addSerde(this, shape, model)
RenderSerdeAttribute.addSensitiveWarningDoc(this, shape, model)
context.enumMeta.render(this)
rustBlock("enum ${context.enumName}") {
context.sortedMembers.forEach { member -> member.render(this) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ sealed class ModuleDocSection {
object CrateOrganization : ModuleDocSection()

object Examples : ModuleDocSection()

object AWSSdkUnstable : ModuleDocSection()
}

sealed class LibRsSection(name: String) : Section(name) {
Expand Down Expand Up @@ -78,6 +80,16 @@ class LibRsGenerator(
}
}

docSection(ModuleDocSection.AWSSdkUnstable).also { docs ->
if (docs.isNotEmpty()) {
containerDocs("\n## Enabling Unstable Features")
docs.forEach { writeTo ->
writeTo(this)
}
}
}


// Examples
docSection(ModuleDocSection.Examples).also { docs ->
if (docs.isNotEmpty() || settings.examplesUri != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/

package software.amazon.smithy.rust.codegen.core.smithy.generators

import software.amazon.smithy.model.Model
import software.amazon.smithy.model.shapes.MemberShape
import software.amazon.smithy.model.shapes.Shape
import software.amazon.smithy.model.traits.ErrorTrait
import software.amazon.smithy.model.traits.SensitiveTrait
import software.amazon.smithy.rust.codegen.core.rustlang.Attribute
import software.amazon.smithy.rust.codegen.core.rustlang.RustWriter
import software.amazon.smithy.rust.codegen.core.rustlang.raw
import software.amazon.smithy.rust.codegen.core.util.hasTrait
import software.amazon.smithy.rust.codegen.core.util.isEventStream
import software.amazon.smithy.rust.codegen.core.util.isStreaming

// Part of RFC30
public object RenderSerdeAttribute {
private const val warningMessage = "/// This data may contain sensitive information; It will not be obscured when serialized.\n"
private const val skipFieldMessage = "/// This field will note be serialized or deserialized because it's a stream type.\n"

// guards to check if you want to add serde attributes
fun isApplicable(shape: Shape, model: Model): Boolean {
return !shape.hasTrait<ErrorTrait>() && shape.members().none { it.isEventStream(model) }
}

public fun addSensitiveWarningDoc(writer: RustWriter, shape: Shape, model: Model) {
if (isApplicable(shape, model) && shape.hasTrait<SensitiveTrait>()) {
writer.writeInline(warningMessage)
}
}

public fun addSerdeWithoutShapeModel(writer: RustWriter) {
Attribute("").SerdeSerialize().render(writer)
Attribute("").SerdeDeserialize().render(writer)
}

public fun addSerde(writer: RustWriter, shape: Shape, model: Model) {
if (isApplicable(shape, model)) {
addSerdeWithoutShapeModel(writer)
}
}

public fun skipIfStream(writer: RustWriter, member: MemberShape, model: Model, shape: Shape) {
if (isApplicable(shape, model) && member.isStreaming(model)) {
writer.writeInline(skipFieldMessage)
Attribute("").serdeSkip().render(writer)
}
}

public fun importSerde(writer: RustWriter, shape: Shape, model: Model) {
if (isApplicable(shape, model)) {
// we need this for skip serde to work
Attribute.AllowUnusedImports.render(writer)
Attribute("").SerdeSerializeOrDeserialize().render(writer)
writer.raw("use serde;")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ open class StructureGenerator(
memberName: String,
memberSymbol: Symbol,
) {
RenderSerdeAttribute.skipIfStream(writer, member, model, shape)
writer.renderMemberDoc(member, memberSymbol)
RenderSerdeAttribute.addSensitiveWarningDoc(writer, shape, model)
writer.deprecatedShape(member)
memberSymbol.expectRustMetadata().render(writer)
writer.write("$memberName: #T,", memberSymbol)
Expand All @@ -184,6 +186,8 @@ open class StructureGenerator(
val containerMeta = symbol.expectRustMetadata()
writer.documentShape(shape, model)
writer.deprecatedShape(shape)
RenderSerdeAttribute.addSerde(writer, shape, model)
RenderSerdeAttribute.addSensitiveWarningDoc(writer, shape, model)
containerMeta.render(writer)

writer.rustBlock("struct $name ${shape.lifetimeDeclaration(symbolProvider)}") {
Expand All @@ -193,6 +197,7 @@ open class StructureGenerator(
writeCustomizations(customizations, StructureSection.AdditionalFields(shape))
}

RenderSerdeAttribute.importSerde(writer, shape, model)
renderStructureImpl()
if (!containerMeta.hasDebugDerive()) {
renderDebugImpl()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ open class UnionGenerator(
open fun render() {
writer.documentShape(shape, model)
writer.deprecatedShape(shape)

RenderSerdeAttribute.addSerde(writer, shape, model)
val containerMeta = unionSymbol.expectRustMetadata()
containerMeta.render(writer)

Expand Down
Loading
Loading