- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 249
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
Schema transformations #2218
Schema transformations #2218
Conversation
As a side note, I think we should either document for users to avoid this pattern, or we should optimize for it. With a small number of cases it won't make a big difference, but it'll add up if they start doing this with a lot of them. api
.transform(Transformer.RenameType("Foo" -> "Bar"))
.transform(Transformer.RenameType("Bar" -> "Baz"))
.transform(Transformer.RenameType("Bla" -> "Bra")) EDIT: For completeness, this is the most performant implementation: api
.transform(Transformer.RenameType(
"Foo" -> "Bar",
"Bar" -> "Baz",
"Bla" -> "Bra",
)) |
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.
Love it ❤️
I have a bunch of places I can use this at $WORK so can start using it once we merge in and report any potential issues.
I think given that this is a really great feature, we should just mark the next release as 2.7.0 and disable MiMa. 2.6.0 doesn't seem to have any reported issues so far so I'm hopeful we won't need to do any patch releases soon
The PR about nullability also breaks mima so we can ship these 2 together. Let's disable mima as you said. Let me give it a final review before merging 🙏 |
* Add transformers * Optimize transformers * Optimize and cleanup API * Make Scala 2.12 happy * Cleanups * Pre-check whether to apply transformers in Transformer.Combined --------- Co-authored-by: Kyri Petrou <[email protected]>
Closes #130
Adds the ability to transform types of an existing schema:
Example usage: