<@U0BMADWBS> thank you for the explanation! While ...
# reflect
b
@aimozg thank you for the explanation! While I also think it would be easier to mark the fields as nullable instead of lateinit, what I'm trying to achieve is an automatic JSON serialization -> Java/Kt object instance. It works, but the problem is that the JSON objects I'm converting come from a service where documentation is lacking (more specifically, the Riot's LoL API), and although they give a list of the JSON fields of each REST response, they don't say which ones are always present and which are optional. I made some tests, and marked the ones I believe that are always present as lateinit, but I started creating some basic unit tests and wanted to reeeeaaaaally validate that they will always be present, while don't having to mark them as nullable and create a null-checking hell when I have to access them in regular code