https://kotlinlang.org logo
#ktor
Title
w

wouterdoeland

01/21/2018, 4:05 PM
So I'm using the Gson automatic json parser with Ktor, but whenever a field is not set in the json, Gson will set that field to null. I don't want that to happen, I just want Gson to throw an exception, because else my application might not function properly (NPE's will be thrown etc.). Is it possible to do this (throw an exception on null field)