Error: Object of type IntervalStrategy is not JSON serializable when add `indent` to verticalize json
I want to save a dataclass to a json file and save it, it is ok now without adding paramenter indent. class EnhancedJSONEncoder(json.JSONEncoder): def default(self, o): if dataclasses.is_dataclass(o): return dataclasses.asdict(o) # return super().default(o) model_json = json.dumps(model_args, cls=EnhancedJSONEncoder) model_args is a…