fred_reimer
01/31/2022, 6:33 PMdef to_dict(self) -> dict:
"""Return a dict mapping the property name to its definition.
Returns:
A JSON Schema dictionary describing the object.
"""
type_dict = self.type_dict
if self.optional:
type_dict = append_type(type_dict, "null")
if self.default:
type_dict.update({"default": self.default})
if self.description:
type_dict.update({"description": self.description})
return {self.name: type_dict}
If default is 0 it does not set the default when converted to a dict. Should be if self.default is not None:
edgar_ramirez_mondragon
01/31/2022, 8:09 PMfred_reimer
01/31/2022, 8:10 PM