-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix Java interop serialization issues #19
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's not possible to call reified inline Kotlin methods from Java so steps return types will have to be explicitly passed. Without `reified inline` generic types are lost by at runtime and cannot be used anymore for deserialization purposes. https://docs.oracle.com/javase/tutorial/java/generics/erasure.html
For now steps return types will need to be: - Public classes - Having public `JsonProperty`s so that getters can be called from the `inngest-core` package. It's quite limiting I think. Getters do not work as expected with Klaxon unless it's declared in Kotlin. But we'll try to improve it later on.
KiKoS0
requested review from
djfarrelly,
darwin67,
jpwilliams and
tonyhb
as code owners
February 24, 2024 15:57
albertchae
approved these changes
Feb 24, 2024
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.
LGTM, we'll investigate whether Record classes introduced in Java 14 are more compatible with Klaxon and/or use different json serialization libraries
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces two serialization fixes for the Java steps calls:
It's not possible to call reified inline Kotlin methods from Java
so steps return types will have to be explicitly passed.
Without
reified inline
generic types are lost by at runtime andcannot be used anymore for deserialization purposes.
https://stackoverflow.com/questions/42741780/how-can-i-call-kotlin-methods-with-reified-generics-from-java/42742119#42742119
JsonProperty
sSo that Getters can be called from the
inngest-core
package.It's quite limiting I think. Getters do not work as expected with Klaxon
unless it's declared in Kotlin. But we'll try to improve it later on.