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

Fix Java interop serialization issues #19

Merged
merged 3 commits into from
Feb 24, 2024
Merged

Conversation

KiKoS0
Copy link
Collaborator

@KiKoS0 KiKoS0 commented Feb 24, 2024

Introduces two serialization fixes for the Java steps calls:

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.

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.
inngest-core/src/main/kotlin/com/inngest/State.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/State.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/State.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/State.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
inngest-core/src/main/kotlin/com/inngest/Step.kt Outdated Show resolved Hide resolved
Copy link
Collaborator

@albertchae albertchae left a 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

@albertchae albertchae merged commit aa95363 into main Feb 24, 2024
7 checks passed
@albertchae albertchae deleted the fix-interop-issues branch February 24, 2024 16:24
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.

2 participants