fred_reimer
01/06/2022, 5:39 PMif type in the first dict composition:
def to_dict(self):
'''Return the raw JSON Schema as a (possibly nested) dict.'''
result = {}
if self.properties is not None:
result['properties'] = {
k: v.to_dict() if type(v) is Schema else v
for k, v
in self.properties.items() # pylint: disable=no-member
}
if self.items is not None:
result['items'] = self.items.to_dict() # pylint: disable=no-member
for key in STANDARD_KEYS:
if self.__dict__.get(key) is not None:
result[key] = self.__dict__[key]
return result