diff --git a/src/main/java/org/warp/commonutils/moshi/MoshiPolymorphic.java b/src/main/java/org/warp/commonutils/moshi/MoshiPolymorphic.java index fcfe58f..6207cbf 100644 --- a/src/main/java/org/warp/commonutils/moshi/MoshiPolymorphic.java +++ b/src/main/java/org/warp/commonutils/moshi/MoshiPolymorphic.java @@ -44,7 +44,7 @@ public abstract class MoshiPolymorphic { private synchronized void initialize() { if (!this.initialized) { this.initialized = true; - var abstractMoshiBuilder = new Moshi.Builder().add(new RecordsJsonAdapterFactory()); + var abstractMoshiBuilder = new Moshi.Builder(); var abstractClasses = getAbstractClasses(); var concreteClasses = getConcreteClasses(); var extraAdapters = getExtraAdapters(); @@ -67,6 +67,8 @@ public abstract class MoshiPolymorphic { extraAdapters.forEach(abstractMoshiBuilder::add); + abstractMoshiBuilder.add(new RecordsJsonAdapterFactory()); + abstractMoshi = abstractMoshiBuilder.build(); } }