Custom JSON encoder for complex number, ndarray or tuple
Can be used in situation when serialization of JSON can be customised
(json_encoders config in pydantic models, custom_encoder in jsonable_encoder
of fastapi, etc.)
- Return type:
dict[Any, Callable[[…], dict[str, Any]]]