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

add support for transforms in codegen #44

Merged
merged 1 commit into from
Jan 14, 2022
Merged

Conversation

lewisjkl
Copy link
Contributor

Adds support for applying transformers from artifacts in codegen.

The argument transformers in the codegen args is for specifying the names of each transformer that should be applied.

@@ -27,7 +27,8 @@ object DumpModelCommand {
val options = (
specsArgs,
repositoriesOpt.map(_.getOrElse(Nil)),
dependenciesOpt.map(_.getOrElse(Nil))
dependenciesOpt.map(_.getOrElse(Nil)),
transformersOpt.map(_.getOrElse(Nil))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kubukoz
Copy link
Member

kubukoz commented Jan 14, 2022

Curious, what's the usecase for this?

@lewisjkl
Copy link
Contributor Author

Curious, what's the usecase for this?

Though I imagine there are a multitude of uses, the reason for doing this now is to make Smithy4s capable of recognizing shapes/traits defined in a separate protocol. For example, if another protocol (defined in a different repo) also defines a discriminated union trait and we want it to be treated the same was as the smithy4s.api#discriminated trait. With this feature, we can implement a transformer which will change all instances of that discriminated to the smithy4s one. We have this situation more or less in an internal use case.

@Baccata Baccata merged commit 05ab381 into main Jan 14, 2022
@Baccata Baccata deleted the support-transforms-codegen branch January 14, 2022 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants