Rewrite and extend custom JSONEncoder in bfxapi/utils/encoder.py to automatically convert floats to strs. Change every Union[Decimal, str] type to Union[Decimal, float, str]. Fix type hinting bug in labeler.py.

This commit is contained in:
Davide Casale
2023-01-25 18:18:15 +01:00
parent 3a6a863796
commit ed12bf473f
6 changed files with 49 additions and 31 deletions

View File

@@ -3,10 +3,8 @@ from typing import Type, Tuple, List, Dict, TypedDict, Union, Optional, Any
from dataclasses import dataclass
from .. labeler import _Type
from .. notification import Notification
JSON = Union[Dict[str, "JSON"], List["JSON"], bool, int, float, str, Type[None]]
from .. utils.encoder import JSON
#region Type hinting for Rest Public Endpoints