Closed MarcusStrobl closed 3 years ago
Hey, I would not return only string, as the models can be used directly in Python and then having only string values whould be a huge downside.
There is a utility function doing almost everything you need in a nested way: https://github.com/VForWaTer/metacatalog/blob/6d69cd4b336fa5558182505baa570ae3f832e391/metacatalog/util/dict_functions.py#L43
We would need to extend the __convert
function underneath for bool
. For convenience, I would suggest to introduce a stringify
parameter to all models to_dict
functions, which calls the serialize function.
The result of find_entry of the API has
datetime
andboolean
in it, which are not JSON serializable. Is it feasible to return onlystring
in the metadata (or maybe a flag or a new function), or is the user supposed to serialize the result himself?