Why do example serializer implementations use `lat...
# serialization
m
Why do example serializer implementations use
lateinit
for required properties? That will just throw an
UninitializedPropertyAccessException
at runtime if the property is missing during deserialization instead of the expected
SerializationException
. Due to the examples I've assumed that such a case can never happen because the descriptor states that these properties are mandatory and it would be checked internally. Doesn't seem to be the case though 😞
s
Sorry for misleading, I'll try to improve this part
🙏 1
m
Thank you! I guess we have to manually throw SerializationExceotion?
s
There's
MissingFieldException
subclass which is thrown from generated code, so you can use it, too
👍 1