I want to serialize a list of object using jsonpickle. Each of these objects contain a list of object within them:
class ImageManipulationConfiguration: region_list = [] def to_json(self): return jsonpickle.encode(self.region_list, indent=4, separators=(',', ': '))
here, region_list
contains objects of this class:
class ImageManipulationRegion: image_manipulation_element_list = []
Inside image_manipulation_element_list
, there are objects of class inheriting this class :
class ImageManipulationElement
When I call my to_json
function, only the top level items in the region_list
are serialized, the sub oject within the image_manipulation_element_list
lists are not included. Is there a way to recursively include everything using jsonpickle?