I am serializing it using my own "writes" but my code looks a lot like Java code. I would like to serialize each option in the check object only if it is defined (the final object should not have any empty values).