-
Notifications
You must be signed in to change notification settings - Fork 193
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: add Serde Decorator to RustClientCodegenPlugin #2650
base: main
Are you sure you want to change the base?
RFC30: add Serde Decorator to RustClientCodegenPlugin #2650
Conversation
NOTE:
|
Oh, it seems to be working now! |
...rc/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/SerdeDecorator.kt
Outdated
Show resolved
Hide resolved
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to also hook into the ModuleDocSection.ServiceDocs
, or even add a new ModuleDocSection.Features
, so that these features can be described in the docs. That way, the documentation can inform on the --cfg aws_sdk_unstable
requirement. This would require registering a LibRsCustomization
, so override fun libRsCustomizations(...)
.
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 comment
The 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?
...rc/main/kotlin/software/amazon/smithy/rust/codegen/client/smithy/customize/SerdeDecorator.kt
Outdated
Show resolved
Hide resolved
ef778af
to
bbb321e
Compare
} | ||
|
||
// I initially tried to implement with LibRsCustomization but it didn't work some how. | ||
companion object { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the text that is going to be included on the lib.rs docs.
I tried to use the libRsCustomization but somehow it didn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did it look like when it was overriding libRsCustomization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to find the commit that didn't work, but it's lost somewhere in the commit history.
44e5fc4
to
f11b919
Compare
e659b74
to
44e5fc4
Compare
…ameron/smithy-rs into RFC30/serde-decorator
…codegen/client/smithy/customize/SerdeDecorator.kt
…codegen/client/smithy/customize/SerdeDecorator.kt modified: codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/smithy/generators/LibRsGenerator.kt
Motivation and Context
Add new plugin to
RustClientCodegenPlugin
No breaking changes are introduced.
Description
The new plugin adds
serde-*
features to generated sdk's Cargo.toml.Users can enable
aws-smithy-type
'sserde
features by passing arguments.Testing
NA
Checklist
NA
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.