File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
http-generator-javalin/src/main/java/io/avaje/http/generator/javalin Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -89,8 +89,13 @@ private void writeClassStart() {
89
89
90
90
for (UType type : jsonTypes .values ()) {
91
91
// Support for CompletableFuture's.
92
- if (type .isGeneric () && type . mainType ().equals ("java.util.concurrent.CompletableFuture" )) {
92
+ if (type .mainType ().equals ("java.util.concurrent.CompletableFuture" )) {
93
93
type = type .paramRaw ();
94
+
95
+ if (this .jsonTypes .containsKey (type .full ())) {
96
+ // Already written before -- we can skip.
97
+ continue ;
98
+ }
94
99
}
95
100
96
101
// Everything else
@@ -113,6 +118,12 @@ private void writeClassStart() {
113
118
}
114
119
if (useJsonB ) {
115
120
for (final UType type : jsonTypes .values ()) {
121
+ // Skip trying to assign a global variable value for any UType that is a Completable Future. Because the paramRaw() should
122
+ // already be in this jsonTypes map anyway and write the assignment all by itself.
123
+ if (type .mainType ().equals ("java.util.concurrent.CompletableFuture" )) {
124
+ continue ;
125
+ }
126
+
116
127
JsonBUtil .writeJsonbType (type , writer );
117
128
}
118
129
}
You can’t perform that action at this time.
0 commit comments