-
Notifications
You must be signed in to change notification settings - Fork 243
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
Feature Suggestion: Custom type adapters #342
Comments
Hi @tnn , Thanks for this suggestion. If you open a pull request, we'd be happy to review a patch for this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the service defintion of the generated code, there is a mismatch between the high level types and the underlying thrift binary serialization strategy. The canonical example for Scala/Java is
UUID
orZonedDateTime
, leading to implementors either polluting their service traits withInt
andLong
's or usingString
s when the customer of those APIs often would like to work in higher level types such asUUID
,ZonedDateTime
- or their own custom such asUserID
.There is multiple ways this could be implemented, however there seems to be an chicken-and-egg problem by the thrift definitions not yet being compiled and generated yet, when loading any custom adapter, therefore the trait for an adapter likely have to be at a lower level.
Please let me know if this is completely off the rails or if something like this is already possible today. I would also like to reference the Java / XML solution, XmlAdapter
The text was updated successfully, but these errors were encountered: