-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Java interop serialization issues (#19)
* Fixes steps serialization when called from Java 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://stackoverflow.com/questions/42741780/how-can-i-call-kotlin-methods-with-reified-generics-from-java/42742119#42742119 https://docs.oracle.com/javase/tutorial/java/generics/erasure.html * Fix for the empty object serialization issue 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.
- Loading branch information
Showing
6 changed files
with
43 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,3 @@ dependencyManagement { | |
tasks.withType<Test> { | ||
useJUnitPlatform() | ||
} | ||
|
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
12 changes: 12 additions & 0 deletions
12
inngest-spring-boot-demo/src/main/java/com/inngest/springbootdemo/Result.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.inngest.springbootdemo; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class Result { | ||
@JsonProperty("sum") | ||
public final int sum; | ||
|
||
public Result(@JsonProperty("sum") int sum) { | ||
this.sum = sum; | ||
} | ||
} |