handle nil values in obj.as_schema_json and Obj.from_json