-
Notifications
You must be signed in to change notification settings - Fork 214
RFC30: add Serde Decorator to RustClientCodegenPlugin #2650
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
base: main
Are you sure you want to change the base?
Changes from 10 commits
2c262f9
3645285
fbcbf04
263eb86
2b1ee72
0b01612
aa9982c
06a3cba
6e38a83
495ad68
a3e8546
c49b208
1c24991
5b5f201
81f7efd
e6dbd97
9e997b6
bbb321e
fa8c04b
918f2cd
8802e83
5211559
88c14cb
c4a41c2
dd4a511
982a95d
954b7e9
de2cdd4
a67a879
cbe908a
7251962
44e5fc4
8a6ff7d
40840ae
dc09315
db679e0
d1b369e
0b8ba89
077d868
348db68
476df23
58c4c53
68a60df
abdf723
1c5fd9a
366a43e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* 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.Feature | ||
import software.amazon.smithy.rust.codegen.core.smithy.RustCrate | ||
|
||
/** | ||
* This class, | ||
* - Adds serde as a dependency | ||
* | ||
*/ | ||
class SerdeDecorator : ClientCodegenDecorator { | ||
override val name: String = "SerdeDecorator" | ||
override val order: Byte = -1 | ||
|
||
override fun extras(codegenContext: ClientCodegenContext, rustCrate: RustCrate) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be good to also hook into the There's an example here that adds information to the "Crate Organization" documentation section: https://github.com/awslabs/smithy-rs/blob/2f60a5e0904037ec5237c080c61817617b9d8c06/codegen-client/src/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customizations/ClientCustomizations.kt#L19 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this function but it seems like there are no changes to the generated code. Is there anything else that I'm supposed to add? |
||
fun _feature(feature_name: String, crate_name: String): Feature { | ||
return Feature(feature_name, false, listOf(crate_name + "/" + feature_name)) | ||
} | ||
rustCrate.mergeFeature(_feature("serde-serialize", "aws-smithy-types")) | ||
thomas-k-cameron marked this conversation as resolved.
Show resolved
Hide resolved
|
||
rustCrate.mergeFeature(_feature("serde-deserialize", "aws-smithy-types")) | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.